What is Ruby Hpricot in Nokogiri?

514 views Asked by At

I am trying to change a ruby script to make it more easily portable. Unfortunately hpricot seems a bit complicated to install on MS Windows and I want to avoid it. My ruby skills are however minimal (or less). How do I replace this with Nokogiri?

htmlText = Net::HTTP.get URI.parse("#{ARGV.shift}?type=embed")
html = Hpricot( htmlText )
1

There are 1 answers

2
Hauleth On

With this

doc = Nokogiri::HTML(open("#{ARGV.shift}?type=embed"))

gotten from http://nokogiri.org/