Created
July 12, 2010 20:30
-
-
Save chopmo/473014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'mechanize' | |
require 'open-uri' | |
url = "http://www.rema1000.dk/Default.aspx?ID=83" | |
doc = Nokogiri::HTML(open(url)) | |
puts "Number of links using Nokogiri: " + doc.search("a").size.to_s | |
agent = Mechanize.new | |
page = agent.get(url) | |
puts "Number of links using mechanize: " + page.search("a").size.to_s | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment