Parse XHTML using Ruby

假如想象 提交于 2019-12-24 03:08:39

问题


Is there any way I can parse a remote html page, in Ruby, preferably using jQuery like selectors?

For example, I could select all the div having a specific class, and get the content of all those elements in an array.

I was trying to use Regex for this, but I think using XML parser would be better.


回答1:


I found hpricot is very similar.



来源:https://stackoverflow.com/questions/2722443/parse-xhtml-using-ruby

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