Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试更改 ruby 脚本以使其更易于移植。不幸的是,在 MS Windows 上安装 hpricot 似乎有点复杂,我想避免它。然而,我的红宝石技能很少(或更少)。如何用 Nokogiri 替换它?
htmlText = Net::HTTP.get URI.parse("#{ARGV.shift}?type=embed") html = Hpricot( htmlText )
有了这个
doc = Nokogiri::HTML(open("#{ARGV.shift}?type=embed"))
来自http://nokogiri.org/