簡體   English   中英

在python中使用寬瓶從不同地區的亞馬遜提取產品價格

[英]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.comAmazon.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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM