Subject: Re: Hpricot and xpath
tag1.rb:6: undefined method `xpath’ for nil:NilClass (NoMethodError)
Do you see the nil in that line? Where is the nil coming from? Is the method
before the .xpath, on line 6, possibly returning a nil and not an Elem?
After pondering that, switch ‘#header’ to ‘.header’!
Thank you for your dot!!!
I follow your suggestion and change to ‘.header’ or “.header” instead
of “#header” and and it works. Ruby returns the tag’s path like this:
/tag1/tag2/div. But I see nowhere in the document about using “.” and
“#” in xpath() or css_path(). Do I miss something in the docucment?