Hpricot scraping in ruby

Include gems/library required before getting startedrequire 'hpricot'require 'net/http'require 'rio'# Pass website url to be scrapedurl = "www.funonrails.com"# Define filename to store file locallyfile = "temp.html"# Save page locallyrio(url) < rio (file)# Open page through hpricotdoc = Hpricot(open(file))Apply hpricot library to get right contentsdoc.at("div.pageTitle")doc/"div.pageTitle"doc.search("div.entry")doc//"div.pageTitle"Hpricot API Reference click here