ebay sdk python错误

时间:2012-10-23 19:57:52

标签: python api ebay

我正在尝试为ebay api使用以下包装器: http://code.google.com/p/ebay-sdk-python/

但是,当我执行以下代码时,我获得了:

from ebaysdk import finding, tag, nodeText

f = finding()
f.execute('findItemsAdvanced', tag('keywords', 'shoes'))
Traceback (most recent call last):
  File "/home/unix/dfernand/bin/lib/python2.7/site-packages/ebaysdk-0.1.6-py2.7.egg/ebaysdk/__init__.py", line 141, in execute
    self._response_content = self._execute_http_request()
  File "/home/unix/dfernand/bin/lib/python2.7/site-packages/ebaysdk-0.1.6-py2.7.egg/ebaysdk/__init__.py", line 244, in _execute_http_request
    raise Exception("%s" % e)
Exception: Internal Server Error

然后尝试获取更多信息,但没有任何有意义的信息出现:

error = f.error()
print error
findItemsAdvanced error:
Exception: Internal Server Error

我不确定错误的来源 - 我尝试将yaml file复制到安装模块的egg文件的位置(即/ home / unix / dfernand / bin / lib / python2。 7 / site-packages /),没有任何变化。

我使用Sandbox密钥填写了yaml文件,然后尝试用生产密钥填充它,然后我更改了名称以匹配我的易趣开发者帐户中的名称等。没有任何作用。我对发生的事情一无所知。有任何想法吗?感谢。

我的yaml文件示例:

    # ebaysdk API Configurations

name: Key Set 1 #(note: here i changed it to Key Set 1, name in ebay website from ebay_api_config)

# Trading - External
api.ebay.com:
    password: _password_
    username: _username_
    appid: myproduction-appid-fromdeveloperssite
    certid: _certid_
    devid: _devid_
    token:
    version: 671
    https: 1

# Shopping
open.api.ebay.com:
    appid: myproduction-appid-fromdeveloperssite
    certid: myproduction-certid-fromdeveloperssite
    devid: myproduction-devid-fromdeveloperssite
    version: 671

# Finding/Merchandising
svcs.ebay.com:
    appid: myprodction-appid-fromdeveloperssite
    version: 1.0.0

1 个答案:

答案 0 :(得分:0)

尝试升级到最新版本。我添加了很多错误处理,这将有所帮助。

https://github.com/timotheus/ebaysdk-python

from ebaysdk import finding

api = finding(appid='YOUR_APPID_HERE', debug=True)
api.execute('findItemsAdvanced', {'keywords': 'shoes'})

print api.response_dict()

添加debug = True将转储http请求/响应。如果您仍然遇到麻烦,请传递请求/回复。