gpt4 book ai didi

bottlenose - 如何修复 HTTP 错误 503 : Service Unavailable error

转载 作者:行者123 更新时间:2023-12-02 04:25:49 28 4
gpt4 key购买 nike

执行命令:

amazon = bottlenose.Amazon(AMAZON_ACCESS_KEY,AMAZON_SECRET_KEY,AMAZON_ASSOC_TAG)
response = amazon.ItemLookup(ItemId='B007OZNUCE')

我得到了错误:
Traceback (most recent call last):
File "exazapi.py", line 37, in <module>
response = amazon.ItemLookup(ItemId='B007OZNUCE')
File "C:\Python\lib\site-packages\bottlenose\api.py", line 274, in __call__
{'api_url': api_url, 'cache_url': cache_url})
File "C:\Python\lib\site-packages\bottlenose\api.py", line 235, in _call_api
return urllib2.urlopen(api_request, timeout=self.Timeout)
File "C:\Python\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Python\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "C:\Python\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)
File "C:\Python\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "C:\Python\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 503: Service Unavailable

#import all the required modules
import re
import csv
import sys
import warnings
from urllib.request import urlopen
from bs4 import BeautifulSoup
from requests_html import HTMLSession

import bottlenose
#from amazon.api import AmazonAPI

AMAZON_ACCESS_KEY='xxx'
AMAZON_SECRET_KEY='xxx'
AMAZON_ASSOC_TAG='xxx'


#ignore warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")


amazon = bottlenose.Amazon(AMAZON_ACCESS_KEY,AMAZON_SECRET_KEY,AMAZON_ASSOC_TAG)
response = amazon.ItemLookup(ItemId='B007OZNUCE')
print (amazon)
print(response)

最佳答案

缺少区域,根据您使用的国家/地区添加“DE”或“ES”之类的内容。

默认为“美国”:

亚马逊=bottlenose.Amazon(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ASSOCIATE_TAG, Region='FR')

来自:https://github.com/lionheart/bottlenose

此外:您是否已在“亚马逊”客户门户网站上检查您要使用的国家/地区的“平台 API”访问权限是否启用了 API?

  • 法国:https://partenaires.amazon.fr/assoc_credentials/home
  • 英国:https://affiliate-program.amazon.co.uk/assoc_credentials/home
  • 美国:https://affiliate-program.amazon.com/assoc_credentials/home

  • 对我来说,它显示不活动,因此,这可能是请求被拒绝的原因。

    关于bottlenose - 如何修复 HTTP 错误 503 : Service Unavailable error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54499967/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com