Python 关于带有瓶鼻的Amazon产品API的错误
我正在使用瓶鼻亚马逊产品API。我只是创建了一些代码,但遇到了以下错误: 我创建的代码:Python 关于带有瓶鼻的Amazon产品API的错误,python,amazon,bottlenose,Python,Amazon,Bottlenose,我正在使用瓶鼻亚马逊产品API。我只是创建了一些代码,但遇到了以下错误: 我创建的代码: ak = "my access key" sk = "My secret key" import bottlenose amazon = bottlenose.Amazon(ak, sk) response=amazon.ItemLookup(ItemId="0596520999", ResponseGroup="Images", SearchIndex="Books", IdType="ISBN"
ak = "my access key"
sk = "My secret key"
import bottlenose
amazon = bottlenose.Amazon(ak, sk)
response=amazon.ItemLookup(ItemId="0596520999", ResponseGroup="Images", SearchIndex="Books", IdType="ISBN",Style="http://xml2json-xslt.googlecode.com/svn/trunk/xml2json.xslt") % reference from the README file of bottlenose
以下是我得到的错误:
Traceback (most recent call last):
File "C:/Python27/amazontest", line 6, in <module>
response=amazon.ItemLookup(ItemId="0596520999", ResponseGroup="Images", SearchIndex="Books", IdType="ISBN",Style="http://xml2json-xslt.googlecode.com/svn/trunk/xml2json.xslt")
File "C:\Users\supercoco\AppData\Roaming\Python\Python27\site-packages\bottlenose\api.py", line 104, in __call__
response = urllib2.urlopen(api_request)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 438, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request
有人知道问题出在哪里吗?我感谢你的回答
谢谢
-抄送
amazon = bottlenose.Amazon(ak, sk)
您需要添加第三个参数:服务标签
amazon = bottlenose.Amazon(ak, sk, service_tag)