[英]Caching urls with Bottlenose python Amazon product advertising API
[英]using bottlenose in python to extract product price from Amazon in different locale
我正在使用寬口水從Amazon提取產品價格,從Amazon.com
提取內容的工作還Amazon.com
,我試圖將搜索范圍擴展到Amazon.co.uk
,我在Amazon.co.uk
申請了一個關聯帳戶,並獲得了新的關聯ID。
amazon_search = bottlenose.Amazon(str(aws_key.aws_access_key),
str(aws_key.aws_secret_key),
str(aws_key.aws_associate_key),
MaxQPS=0.9)
item_details = BeautifulStoneSoup(amazon_search.ItemLookup(ItemId=item_asin.text,ResponseGroup="OfferSummary")
我使用了上面的代碼,即使更改了associate_key
,為什么對Amazon.com
和Amazon.co.uk
的輸出相同?
在amazon_search
類中列出該屬性將告訴您原因:
print amazon_search.__dict__
{'MaxQPS': 0.9, 'AWSAccessKeyId': 'xxxxxxxxxx', '_last_query_time': [None], 'AWSSecretAccessKey': 'xxxxxxxxxx', 'Region': 'US', 'Parser': None, 'CacheReader': <function amazon_search_details_cache_read_fx at 0x31841b8>, 'ErrorHandler': None, 'Version': '2011-08-01', 'Timeout': None, 'AssociateTag': 'xxxxxxxxxx-20', 'CacheWriter': <function amazon_search_details_cache_write_fx at 0x31840c8>, 'Operation': None}
將屬性Region
添加到所需的任何區域都可以解決該問題。 剛剛測試,它可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.