$
gem install nokogiriBuilding native extensions. This could take a while... Successfully installed nokogiri-1.4.2 1 gem installed Installing ri documentation for nokogiri-1.4.2... Installing RDoc documentation for nokogiri-1.4.2...
#!/usr/bin/env ruby require 'rubygems' require 'nokogiri' require 'open-uri' url = "http://www.hnilica.cz/radek/book/ruby/index.html" url = "http://www.walmart.com/search/search-ng.do?search_constraint=0&ic=48_0&search_query=arduino&Find.x=0&Find.y=0&Find=Find" doc = Nokogiri::HTML(open(url)) puts doc.at_css("title").text doc.css(".item").each do |item| title = item.at_css(".prodLink").text price = item.at_css(".PriceCompare .BodyS, .PriceXLBold").text[/\$[0-9\.]+/] puts "#{title} - #{price}" puts item.at_css(".prodLink")[:href] end