Nokogiri vs Hpricot?

断了今生、忘了曾经 提交于 2019-12-31 08:58:05

问题


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).

回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/2888587/nokogiri-vs-hpricot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!