Skip to content

Instantly share code, notes, and snippets.

@ZuluagaSD
Created December 2, 2012 03:28
Show Gist options
  • Save ZuluagaSD/4186829 to your computer and use it in GitHub Desktop.
Save ZuluagaSD/4186829 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
url = "http://www.icefilms.info/"
doc = Nokogiri::HTML(open(url))
shows = ['Two and a Half Men', 'Something else']
puts doc.at_css("title").text
puts doc.xpath('//div[@id="fp_articles"]/h1').text
doc.xpath('//div[@id="fp_articles"]/p/a/img[@alt="Two and a Half Men"]').each do |show|
#link = show['href']
puts show
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment