Price Scraping Script - Any recommendations?

MikevanderHeijd

corporate hustler
Oct 11, 2008
448
8
0
Australia
Top of the day brethren!

Basically what I'm looking for is a script (or WP plugin) that can scrape product prices of sites that I enter.

As you can tell, I am kinda new to all of this scraping/automating process of websites.

Any advice would be greatly appreciated :cool:
 


Bro, at one point you've gotta stop thinking about the world in terms of Wordpress Plugins and start investing in yourself.

Code:
require "open-uri"
require "nokogiri"

keywords = "tickle me elmo"
url = "http://www.amazon.com/s/keywords=#{URI.escape(keywords)}"

doc = Nokogiri::HTML(open(url))
puts doc.at("#result_0").to_s[/\$\d+\.?\d{0,2}/]
This Ruby script launches an Amazon search for arbitrary keywords and displays the first "$<digits>.<digit><digit>" match that it finds in the first result.