Nokogiri vs Hpricot?
Asked Answered
F

3

24

Which one would you choose? My important attributes are (not in order):

  1. Support and future enhancements.
  2. Community and general knowledge base (on the Internet).
  3. Comprehensive (I.E., proven to parse a wide range of *.*ml pages).
  4. Performance.
  5. Memory footprint (runtime, not the code-base).
Franke answered 22/5, 2010 at 15:5 Comment(0)
P
36

Pick Nokogiri, for all points and especially point one: Hpricot is no longer maintained.

Meta answer: See ruby-toolbox to get an idea of the popularity of different tools in a given area.

Parboil answered 22/5, 2010 at 16:53 Comment(1)
update - hpricot is no longer being maintained, which makes the choice even easier.Grum
L
8

Only pick Hpricot if you don't have, or can't install, LibXML on the computer you're using. If this is not the case then choose Nokogiri, it's better in the five mentioned attributes than Hpricot.

Logia answered 22/5, 2010 at 17:2 Comment(1)
Since literally a couple of minutes ago, there's also a pure-Java version of Nokogiri. So, you can use Nokogiri on JRuby without FFI and without libxml. (Google App Engine is one example where FFI is not possible.)Lardon
M
6

The case where I've found Hpricot to be useful is in dealing with broken HTML that you need to remain broken after processing. Hpricot is good about modifying only the portion of a document you have updated. Unless this is needed, Nokogiri is the way to go.

Meaningful answered 15/2, 2011 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.