开发者

Scanning each HTML node with nokogiri

开发者 https://www.devze.com 2022-12-11 15:26 出处:网络
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?

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

精彩评论

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