开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜