Vita Rara: A Life Uncommon


Hpricot to Nokogiri Day 1

Categories: | |

Nokogiri's #xpath != Hpricot's #xpath

In Hpricot you can call xpath on a node to get the XPath that will retrieve that node from the document. In Nokogiri that equivalent is path.

I ran into this trying to figure out the xpath to a node in an HTML document. My normal routine is to load up the document in IRB and poke around to find the things I need.

Syndicate content