Scanning each HTML node with nokogiri
How can we scan each element and sub-element of an HTML document with Nokogiri, and testing for each one if the current tag is a block?
Accordin开发者_如何学Cg to http://wiki.github.com/tenderlove/nokogiri/examples, we can test if an element is a block using:
element[:class] == "block"
But I don't see how to scan and test each HTML ones...
Thanks.
The very useful traverse
function lets you iterate through every element of the document. See the doc.
精彩评论