Method to parse HTML document in Ruby?

Harish Kurup picture Harish Kurup · Mar 31, 2010 · Viewed 32.5k times · Source

like DOMDocument class in PHP, is there any class in RUBY (i.e the core RUBY), to parse and get node elements value from a HTML Document.

Answer

Marc-André Lafortune picture Marc-André Lafortune · Mar 31, 2010

There is no built-in HTML parser (yet), but some very good ones are available, in particular Nokogiri.

Meta-answer: For common needs like these, I'd recommend checking out the Ruby Toolbox site. You'll notice that Nokogiri is the top recommendation for HTML parsers