【问题标题】:urllib.error.HTTPError: HTTP Error 400: Bad Requesturllib.error.HTTPError:HTTP 错误 400:错误请求
【发布时间】:2019-11-05 11:59:15
【问题描述】:

我正在尝试在亚马逊产品广告上进行一些搜索,并使用 botlenose 来帮助我做到这一点。但是,我刚刚收到 HTTP 错误 400。

其他一些重要信息:

我来自巴西,我的 TAG 也来自亚马逊。这是个问题吗?

我确实检查了我的 KEY、Secret 和 TAG,没关系。我确实在 StackOverflow 上查看了其他一些问题,但对我没有任何帮助。

import bottlenose
AWS_ACCESS_KEY_ID="XXXXXXXXXXXXXXX"
AWS_SECRET_ACCESS_KEY="xxxxxxxxxxxxxxxxxxxxxxx"
AWS_ASSOCIATE_TAG="yyyyyyyyyyy"
amazon = bottlenose.Amazon(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ASSOCIATE_TAG,  Region='BR')
response = amazon.ItemLookup(ItemId="B007OZNUCE")

enter code here# 当然,出于安全原因,我更改了密钥。

Traceback(最近一次调用最后一次): 文件“”,第 6 行,在 调用中的文件“/Users/am/Documents/PycharmProjects/08/lib/python3.7/site-packages/bottlenose/api.py”,第 274 行 {'api_url':api_url,'cache_url':cache_url}) _call_api 中的文件“/Users/am/Documents/PycharmProjects/08lib/python3.7/site-packages/bottlenose/api.py”,第 235 行 返回 urllib2.urlopen(api_request, timeout=self.Timeout) 文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py”,第 222 行,在 urlopen 返回 opener.open(url, 数据, 超时) 文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py”,第 531 行,打开 响应=方法(请求,响应) http_response 中的文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py”,第 641 行 'http', 请求, 响应, 代码, msg, hdrs) 文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py”,第 569 行,错误 返回 self._call_chain(*args) _call_chain 中的文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py”,第 503 行 结果 = 函数(*args) http_error_default 中的文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py”,第 649 行 引发 HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError:HTTP 错误 400:错误请求

【问题讨论】:

    标签: python amazon bottlenose


    【解决方案1】:

    之后,我尝试通过以下方式生成签名的 url: http://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html

    并尝试将两个网址(通过瓶鼻和亚马逊链接)都放入,并且都返回相同的错误>后来我通过浏览器尝试了相同的网址,我收到了错误:

    <ItemLookupErrorResponse xmlns="http://ecs.amazonaws.com/doc/2013-08-01/">
    <Error>
    <Code>AWS.InvalidAccount</Code>
    <Message>
    Your AccessKey Id is not registered for Product Advertising API. Please use the AccessKey Id obtained after registering at https://affiliate-program.amazon.com/assoc_credentials/home.
    </Message>
    </Error>
    <RequestID>4d761947-8b00-44d4-a9c0-0a9079e8d603</RequestID>
    </ItemLookupErrorResponse>
    

    现在,我正在联系亚马逊支持来修复它。

    谢谢大家!

    【讨论】:

      猜你喜欢
      • 2020-03-26
      • 2020-03-06
      • 2017-08-10
      • 2017-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-22
      相关资源
      最近更新 更多