通过亚马逊产品API获取子类的销售排名(最好使用Python的Bottlenose)

2 投票
1 回答
1512 浏览
提问于 2025-04-18 18:33

我正在尝试获取产品子类别的销售排名(如果适用),这是我用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

原始页面(也就是详细页面的链接)是: 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),那么我该如何获取另外两个排名呢?

1 个回答

1

我也希望能在这个帖子上找到答案,因为我在找同样的解决办法。

到目前为止,我在网上找到的只有这个亚马逊论坛的帖子,里面说这件事做不了。如果我找到答案,我会回来分享的。

撰写回答