zoukankan      html  css  js  c++  java
  • Amazon-Scraper API

    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

  • 相关阅读:
    剑指offer_11:二进制中1的个数
    剑指offer_10:矩形覆盖
    spring mvc 访问静态资源
    spring context:component-scan ex
    spring aop配置未生效
    415 Unsupported Media Type
    spring mvc 接收List对象入参
    JIRA甘特图
    JIRA的工时
    JIRA导出工作日志到Excel
  • 原文地址:https://www.cnblogs.com/szzshi/p/6944665.html
Copyright © 2011-2022 走看看