最佳Rails HTML解析器 [英] Best Rails HTML Parser

查看:74
本文介绍了最佳Rails HTML解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Hpricot仍然是一个标准,但是我记得曾经听说过一个更快,更富表现力的Ruby HTML解析器.

I know that Hpricot is still a standard but I remember hearing about a faster more expressive HTML parser for Ruby.

有人知道它叫什么吗?是否值得从Hpricot切换到它?

Does anybody know what it's called and if it is worth switching to from Hpricot??

预先感谢

推荐答案

您可能正在考虑 Nokogiri . 我本人还没有使用过它,但是每个人"都在谈论它,并且基准看起来很有趣:

You are probably thinking about Nokogiri. I have not used it myself, but "everyone" is talking about it and the benchmarks do look interesting:

hpricot:html:doc  48.930000 3.640000 52.570000 ( 52.900035)
hpricot2:html:doc  4.500000 0.020000  4.520000 (  4.518984)
nokogiri:html:doc  3.640000 0.130000  3.770000 (  3.770642)

这篇关于最佳Rails HTML解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆