Motyar

@motyar

Freelance Web Developer

Static Web Hosting, made easy

Jan 28, 2014

Fetching Amazon product information using WSM API

WSM API?
Its Web Scrape Master API. Simplest way to Scrape web without writing code.

Using Visual Web Scraper to decide xpaths and generate API URL
Visual Web Scraper is simple to use, just paste URL and click "Scrape this page". On next page you can select any element just by clicking on it. Try this link.
If you have clicked on Item Title (for example). Here is your API URL http://motyar.info/webscrapemaster/api/?url=http://www.amazon.com/Micro-Scooter-T-bar-Handle-Childrens/dp/B00BR1GPLY/&xpath=//h1[@id=title]

Got that, What if you need more elements?
Good news, You can do this, you can fetch more than one element from one webpage in on API call. Just click on "Try again" and click on another element. For example if you have clicked on price, you will get this xpath
//span[@id=priceblock_ourprice]

You can use comma separated xpaths in API URL. Add this xpath to your last API URL.
http://webscrapemaster.com/api/?url=http://www.amazon.com/Micro-Scooter-T-bar-Handle-Childrens/dp/B00BR1GPLY/&xpath=//h1[@id=title],//span[@id=priceblock_ourprice]


Here is an example link with most of the information from Amazon product page
http://motyar.info/webscrapemaster/api/?url=http://www.amazon.com/Micro-Scooter-T-bar-Handle-Childrens/dp/B002QXT6W2/&xpath=//h1[@id=title],//img[@id=landingImage],//span[@id=priceblock_ourprice],//div[@id=productDescription]/div/div,//div[@id=avgRating]/span,//div[@id=detail-bullets]/table/tbody/tr/td/div/ul/li[1]

You can change the ASIN code in URL to fetch other product pages.

I am on twitter as @motyar or you can contact me if you need any help.
Thanks

Labels: , , , ,




By :