简体   繁体   English

如何在 Python 中使用 ebay sdk?

[英]How to use ebay sdk in Python?

I have found this code sample to make a query in ebay from here and also downloaded ebay-sdk for Python.我找到了这个代码示例,可以从这里在 ebay 中进行查询,并且还下载了 Python 的 ebay-sdk。 How can I install the sdk and integrate this code with it?如何安装 sdk 并将此代码与其集成?

from ebaysdk import finding, nodeText

f = finding()
f.execute('findItemsAdvanced', {'keywords': 'shoes'})

dom    = f.response_dom()
mydict = f.response_dict()
myobj  = f.response_obj()

print myobj.itemSearchURL

# process the response via DOM
items = dom.getElementsByTagName('item')

for item in items:
    print nodeText(item.getElementsByTagName('title')[0])

It is quite a simple process这是一个非常简单的过程

1) Go to http://developer.ebay.com/ , register over there, and get the app id key. 1) 去http://developer.ebay.com/ ,在那里注册,并获取应用程序 id 密钥。

2) You can simply do a 'pip install ebaysdk' to install the ebaysdk 2)你可以简单地做一个'pip install ebaysdk'来安装ebaysdk

3) Copy this file in the same directory https://github.com/timotheus/ebaysdk-python/blob/master/ebay.yaml In this file replace appid with what you generated in step 1 3) 将此文件复制到同一目录https://github.com/timotheus/ebaysdk-python/blob/master/ebay.yaml在此文件中,将appid替换为您在步骤 1 中生成的内容

4) Execute the example, this time it will work :) 4) 执行例子,这次就可以了:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM