0

我正在尝试使用 FindingAPI,但我在使用 PROD 凭据时遇到此错误。我认为问题出在 API 之内。

我的代码很简单:

try:
    api = Connection(config_file='ebay.dev.yml',  domain="api.ebay.com", debug=True, iteid='EBAY-US', escape_xml=False)
    request = {
        'keywords': "go pro 8",
        'itemFilter': [
            {'name': 'Condition', 'value': 'used'},
            {'name': 'SoldItemsOnly', 'value': 'true'}
        ],
        'paginationInput': {
            'entriesPerPage': 1,
            'pageNumber': 1
        },
        'sortOrder': 'PricePlusShippingLowest'
    }


    response = api.execute('findCompletedItems', request)
    print(response)

except ConnectionError as e:
    print(e)
    print(e.response.dict())

这给了我这个错误:

2020-11-13 06:02:36,022 ebaysdk [DEBUG]:status code=202
2020-11-13 06:02:36,022 ebaysdk [DEBUG]:headers={'Date': 'Thu, 12 Nov 2020 22:02:36 GMT', 'Server': 'Synapse-HttpComponents-NIO', 'Transfer-Encoding': 'chunked', 'Strict-Transport-Security': 'max-age=31536000'}
2020-11-13 06:02:36,023 ebaysdk [DEBUG]:content=
2020-11-13 06:02:36,023 ebaysdk [DEBUG]:response parse failed: Document is empty, line 1, column 1 (<string>, line 1)
2020-11-13 06:02:36,024 ebaysdk [ERROR]:findCompletedItems: Accepted
'findCompletedItems: Accepted'
{'findCompletedItemsResponse': 'parse error Document is empty, line 1, column 1 (<string>, line 1)'}

任何人都知道如何使它成功?我尝试的是调整ebay yml,这似乎适用于TradingAPI调用,但由于某种原因不适用于此FindingAPI 。我已经检查了 github 存储库中的相关问题,但我也找不到

4

1 回答 1

0

您需要更改导入。您的导入可能是“from ebaysdk.trading import Connection”,您需要将其更改为“from ebaysdk.finding import Connection”

于 2020-11-26T20:47:21.493 回答