Skip to main content
 首页 » 编程设计

python之通过亚马逊产品 api 的子类别的销售排名(最好在使用 bottlenose 的 python 中)

2025年05月04日15softidea

我正在尝试检索产品子类别的销售排名(如果适用),这是我用 Python 编写的脚本

amazon=bottlenose.Amazon('AmazonCredentials',MaxQPS=0.9) 
response = amazon.ItemLookup(ItemId="B007SNQ4FM", ResponseGroup="Large", ) 
x = etree.XML(response) 
string_to_store=etree.tostring(x, pretty_print = True) 
print string_to_store 

我从亚马逊得到的回应

.............. 
................ 
<SalesRank>12677</SalesRank> 
  <SmallImage> 
    <URL>http://ecx.images-amazon.com/images/I/31Nk86so5xL._SL75_.jpg</URL> 
    <Height Units="pixels">75</Height> 
    <Width Units="pixels">26</Width> 
  </SmallImage> 
.......... 
.......... 

实际响应可以在这里看到:http://pastebin.com/rCUKCbas

原始页面(即详细页面url)url: http://www.amazon.com/Luma-Comfort-EC45S-Evaporative-Cooling/dp/B007SNQ4FM%3FSubscriptionId%3DAKIAICPZU6FE2WKAQMZQ%26tag%3Drelierscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB007SNQ4FM

来自网络的产品详细信息:

ASIN: B007SNQ4FM 
Item model number: EC45S 
Average Customer Review:  2.4 out of 5 stars  See all reviews (59 customer reviews) 
Amazon Best Sellers Rank: #12,677 in Home & Kitchen (See Top 100 in Home & Kitchen) 
#1 in Home Improvement > Appliances > Range Hoods 
#18 in Home & Kitchen > Heating, Cooling & Air Quality > Air Conditioners & Accessories     > Portable 

在上面我们可以看到它在不同的类别下有三个排名,但是通过使用产品 api 我只能获得一个排名 (12,677),但我如何检索其他两个排名。

请您参考如下方法:

我也希望在这篇文章中得到答案,因为我正在寻找相同的解决方案。

到目前为止,我在网上找到的所有内容都是 this Amazon Forum post说做不到。 如果我找到答案,我会回来发布。