首页 > Windows开发 > 详细

Amazon-Scraper API

时间:2017-06-05 16:22:17      阅读:737      评论:0      收藏:0      [点我收藏+]

After watching Python Web Video. I planned to write a small scraper to fetch the price and promotion of the items in my Amazon Cart. 

Amazon did not allow arbitary access to their web except its own APIs. 

It takes me some time to become An Associate account and a AWS account, it requires that you have your own website.  

One note : 

    Your Associate ID works only in the locale in which you register. If you want to be an Associate in more than one locale, you must register separately for each locale.

Once you have the Associate Tag and AWS Access Keys, you can try the Product Advertising API Scratchpad(websevices.amazon.com/scratchpas/index.html) to do some real-time scrape. 

example:

===================================================================

from amazon.api import AmazonAPI
import bottlenose.api

amazon = AmazonAPI(AMAZON_ACCESS_KEY,AMAZON_SECRET_KEY,AMAZON_ASSOC_TAG,region=AMAZON_REGION) # ** constuct the API by inputing your own AWS infos

product = amazon.lookup(ItemId=str(item)) #** get the full infos to the product, the return type is a class

print product.title, product.color,product.price_and_currency,product.publisher,product.availability

 

Amazon-Scraper API

原文:http://www.cnblogs.com/szzshi/p/6944665.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!