From: transfire@... Date: 2006-07-12T07:06:43+09:00 Subject: Re: Decent HTML Parser? Kevin Weller wrote: > Anybody have experience with a decent HTML parser for a Ruby > application? I've looked around, and so far everything I've found is > either unfinished, unstable, [relatively] undocumented, or just plain > ugly in terms of API. > > I'd like a parser that can take a partial HTML file and return an > easily-traversable data structure, in the same order that the elements > appear in the file. I don't want or need a callback mechanism, only > something I can iterate and tree-search. Though I don't hold much hope > it will work, I will try using REXML on my text and see what it > produces...results to be posted here. Thanks in advance! I also metion Facets' tagiterator.rb (from ���nyasu's tagiter.rb) For example: a = TagIterator.new(stext) a.first("body") do |y| y.nth("dl",2) do |dl| dl.enumtag("dt") do |t| puts t.text.strip end end end http://facets.rubyforge.org/api/more/classes/TagIterator.html T.