tags:

views:

462

answers:

1

Hi,

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?

According 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.

+1  A: 

The very useful traverse function lets you iterate through every element of the document. See the doc.

glenn mcdonald