gpt4 book ai didi

jquery - 最像 jQuery 的 Ruby HTML 解析器

转载 作者:太空宇宙 更新时间:2023-11-03 16:59:33 26 4
gpt4 key购买 nike

如果我已经熟悉/喜欢 jQuery,我会发现哪种 Ruby HTML 解析器最容易使用?

这样的解析器将具有 jQuery 的总体理念——“获取一些 HTML 元素(使用 CSS 选择器)并用它们做事”——此外还具有 jQuery 的所有 DOM 操作功能的等价物(prepend() after() 等)。

显然,服务器端解析器支持 jQuery 事件、效果或 AJAX 功能是没有意义的。

编辑: Hpricot 在这方面做得很好(例如,doc.search('#menu').inner_html)——有什么更好的 API 吗? (当我用谷歌搜索“nokogiri v. hpricot”时,我得到的只是速度比较。我不关心速度!我只想要一个有趣/易于使用的库!)

最佳答案

您可能最熟悉 Hpricot .哎呀,它甚至在首页上说:

Hpricot is a very flexible HTML parser, based on Tanaka Akira’s HTree and John Resig’s jQuery, but with the scanner recoded in C. I’ve borrowed (what I believe to be) the best ideas from these wares to make Hpricot heaps of fun to use.

关于jquery - 最像 jQuery 的 Ruby HTML 解析器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1223793/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com