简体   繁体   English

没有使用Amazon API获得Amazon SalesRank

[英]Not getting amazon SalesRank using amazon API

I was using ItemLookup to get SalesRank using Amazon Product API. 我正在使用ItemLookup通过Amazon Product API获取SalesRank。 I am using python amazon product api 我正在使用python亚马逊产品api

import amazonproduct
from lxml import objectify 
config = {
    'access_key': 'access key',
    'secret_key': 'secret key',
    'associate_tag': 'associate tag',
    'locale': 'us'
}
amazon = amazonproduct.API(cfg=config) 

result = amazon.item_lookup('B01B83IWH0', ResponseGroup="SalesRank")

but when i print the results their is no SalesRank, has amazon stopped giving SalesRank? 但是当我打印结果时,它们不是SalesRank,亚马逊是否停止提供SalesRank?

AttributeError: no such child: {http://webservices.amazon.com/AWSECommerceService/2011-08-01}SalesRank

I tried using amazon scratchpad but it also didn't give SalesRank but they have mention in their documentation to get SalesRank. 我尝试使用亚马逊暂存器,但它也没有提供SalesRank,但他们在文档中已提及要获得SalesRank。 How do I get SalesRank or if their is any alternative(I tried web scraping but amazon blocks me frequently). 如何获得SalesRank或是否可以使用SalesRank(我尝试过网络抓取,但亚马逊经常阻止我)。 Please help, I am a beginner in using API's. 请帮助,我是使用API​​的初学者。

Using this library: https://pypi.python.org/pypi/python-amazon-simple-product-api 使用此库: https : //pypi.python.org/pypi/python-amazon-simple-product-api

from amazon.api import AmazonAPI

api = AmazonAPI(ACCESS_KEY, ACCESS_KEY_SECRET, amazon_tag)

item= api.item_lookup('B01B83IWH0')

# Get Sales Rank
rank = item.sales_rank

This gets rank, but doesn't seem to reflect the current rank listed on Amazon's website. 这会获得排名,但似乎无法反映出亚马逊网站上列出的当前排名。 I'm only just familiarizing myself with the Amazon API, will update with elaboration and details. 我只是熟悉Amazon API,将进行详细说明和更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM