- 授权协议: 未知
- 开发语言: Ruby
- 操作系统: 跨平台
- 软件首页: http://github.com/hpricot/hpricot
软件介绍
Hpricot是一个HTML解释的库。Hpricot允许开发者通过CSS-selectors和X-Path访问html元素,因此你很轻松就可以明确目标标记,还有它是用C语言写的,因此相当快。
安装方法:gem install hpricot
示例代码:
require 'hpricot'
doc = Hpricot(@html)
pars = Array.new
doc.search("div[@id=content]/p").each do |p|
pars << p.inner_html
end
