在Ruby中解析HTML文档的方法? [英] Method to parse HTML document in Ruby?
本文介绍了在Ruby中解析HTML文档的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
类似于PHP中的DOMDocument类,RUBY(即核心RUBY)中是否有任何类可以解析并从HTML文档中获取节点元素的值.
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.
推荐答案
尚无内置HTML解析器,但有一些非常好的HTML解析器,尤其是
There is no built-in HTML parser (yet), but some very good ones are available, in particular Nokogiri.
元答案:对于此类常见需求,建议您访问 Ruby Toolbox 网站.您会注意到,Nokogiri是 HTML解析器
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
这篇关于在Ruby中解析HTML文档的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文