我期望它返回类别和子类别的列表,但是我得到的输出与之完全不同。
脚本:
import json
import datetime
import ebaysdk
from ebaysdk.trading import Connection as Trading
def getUser():
api = Trading(config_file='ebay.yaml')
f = open('json_cat_output.txt','w')
api.execute('GetCategories', {'CategorySiteID': 0},{'DetailLevel': "ReturnAll"})
dictstr = api.response.dict()
print dictstr
dump_file = json.dumps(dictstr, indent=4, default=str)
f.write(dump_file)
f.close()
if __name__ == "__main__":
getUser()
脚本执行的输出:
{
"UpdateTime": "2018-04-10T02:31:49.000Z",
"Version": "1057",
"Ack": "Success",
"Timestamp": "2018-07-09T18:41:48.391Z",
"MinimumReservePrice": "0.0",
"ReservePriceAllowed": "true",
"CategoryVersion": "118",
"Build": "E1057_CORE_APICATALOG_18691267_R1"
}