通过亚马逊产品API获取子类的销售排名(最好使用Python的Bottlenose)
我正在尝试获取产品子类别的销售排名(如果适用),这是我用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
来自网页的产品详情:
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),那么我该如何获取另外两个排名呢?