views:

147

answers:

1

How would you build a price comparison script? I know Amazon offers a public API, but I saw these two sites goodreads, bookdope which compare book prices, retrieve prices from Walmart and others websites that do not offer APIs. How do you get prices from sites that do not have an API?

I'm using C# and ASP.NET MVC.

+1  A: 

If the site does not offer an API then you need to do what is called screen scraping. You get the HTML of the page and you have your program extract the information out of it.

This works, but beware of the problems.

Companies ofen don't like you doing this. If they wanted you to get the information they'd have provided an API. They may even detect a high number of hits from your specific location and block you.

Above all else, the page is designed for a human to read in a browser. They can change it at any time and your application may fail as a result.

Colin Mackay
This is the express train to insanity John.We tried this 10 years ago and have since decided that this is a very bad idea.Every subtle change to the sites you are [sraping] will potentially bring your site to a screaming and spectacular halt.I'd give the sites a call and see if there is a way to get the data. You never know, they may be willing to play ball.
griegs
Indeed - That's why I said there were problems with screen scraping.
Colin Mackay