【问题标题】:Ebay Find API parse error Document is empty, line 1Ebay Find API parse error Document is empty, line 1
【发布时间】:2020-11-13 00:32:16
【问题描述】:

我正在尝试使用 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 repo 的相关问题,但我也找不到一个

【问题讨论】:

    标签: python ebay-api ebay-sdk


    【解决方案1】:

    您需要更改导入。 您的导入可能是“来自 ebaysdk.trading 导入连接”,您需要将其更改为 "从 ebaysdk.finding 导入连接"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多