I have trouble printing simple text from a <h1>
element:
require 'nokogiri'
doc = Nokogiri::HTML("<h1><em>Name</em>A Johnson </h1>")
puts doc.at_xpath("//h1").content
It outputs:
NameA Johnson
I want just A Johnson
in the output. Is it possible to select just this text using XPath or CSS selectors?