item_get - 获得EBAY商品详情

解析了一个EBAY上的商品详情,该商品为250克有机顶级茉莉龙珠绿茶,售价118.3美元,来自中国福建,净重250克,保质期18个月,包装为袋装,存储需干燥通风。健康益处包括提神醒脑、清热利尿等。

item_get - 获得EBAY商品详情

在这里插入图片描述

测试网址:http://console.open.onebound.cn/console/?i=eidi

Result Object:
---------------------------------------
{
	"item": {
		"detail_url": "https://www.ebay.com/itm/0-/331712743699",
		"title": "250g Organic Premium King grade Jasmine Dragon Pearl Chinese GREEN TEA for sale online  eBay",
		"brand": "",
		"rootCatId": null,
		"cid": null,
		"item_imgs": [
			{
				"url": "https://i.ebayimg.com/images/g/oPkAAOSwsD1bxJHc/s-500.jpg"
			},
			{
				"url": "https://i.ebayimg.com/images/g/ywkAAOSwbetbxJHF/s-500.jpg"
			}
		],
		"nick": "lu-3529",
		"num": 99,
		"num_iid": "331712743699",
		"pic_url": "https://i.ebayimg.com/images/g/oPkAAOSwsD1bxJHc/s-500.jpg",
		"price": "118.3",
		"orginal_price": "",
		"delivery": "",
		"location": "",
		"express_fee": "",
		"shipping_to": "",
		"sku": "",
		"property_alias": "",
		"props_list": [],
		"seller_info": {
			"nick": "lu-3529",
			"delivery_score": "",
			"item_score": "",
			"sid": "",
			"title": "lu-3529",
			"zhuy": "https://www.ebay.com/usr/lu-3529",
			"shop_name": "lu-3529"
		},
		"skus": {
			"sku": []
		},
		"props": [],
		"desc": "<script type=\"text/javascript\"> \r\n\t\twindow.onerror = function(message, url, line) {\r\n\t\t\treturn true;\r\n\t\t};\r\n\t</script>\r\n\t<script type=\"text/javascript\"> \r\n\t\tvar ebayItemID='132820629605';\r\n\t\tvar ebayItemRevisionTime='1543840528000';\r\n\t\tvar ebayAskSellerURL='';\r\n\t\tvar _odtTitle = '';\r\n\t\tvar _odtSubTitle = '';\r\n\t\tvar _isTranslError = false;\r\n\t\tvar _sellerId = '';\r\n\t\tvar _dmn = 'ebay.com';\r\n\t</script>\r\n\t<script type=\"text/javascript\">\r\n\ttry{\r\n\t\tvar jsonObj = {};\r\n\t\tvar hashParam = document.location.hash;\r\n\t\tif(hashParam && hashParam.length > 0){\r\n\t\t\thashParam = decodeURI(hashParam.replace('#', ''));\r\n\t\t}\r\n\t\tif(hashParam && typeof(hashParam) === 'string'){\r\n\t\t\tjsonObj = JSON.parse(hashParam);\r\n\t\t}\r\n\t\tif(jsonObj && jsonObj.jsUrl){\r\n\t\t\tvar jsUrl = jsonObj.jsUrl;\r\n\t\t\tvar script = document.createElement('script');\r\n\t\t\tif(jsUrl.indexOf('//') != -1){\r\n\t\t\t\tscript.src = jsUrl;\t\r\n\t\t\t}else{\r\n\t\t\t\tscript.src = '//ir.ebaystatic.com/rs/v/'+jsUrl+'.js';\r\n\t\t\t}\r\n\t\t\tscript.defer = true;\r\n\t\t\tdocument.head.appendChild(script); \r\n\t\t}\r\n\t\tif(jsonObj && jsonObj.title){\r\n\t\t\tvar title = jsonObj.title;\r\n\t\t\tdocument.title = title;\r\n\t\t}\r\n\t}catch(e){\r\n\t\t\r\n\t}\r\n\t</script>\r\n\t<title>eBay</title>\r\n\t<table align=\"center\" style=\"border-spacing: 0px; width: 100%;\">\n\t<tr>\n\t\t<td>\n\t\t\t<div id=\"ds_div\">\n\t\t\t\t\t\t\t<p>\n\t<span style=\"font-family:'times new roman', times, serif;\"><span style=\"font-size:20.0px;\"><strong>250g Green Tea With Jasmine Flower Tea Pearl Pure Natural Good Quality Jasmine Tea Pearl</strong></span></span> \n</p>\n<p>\n\t<span style=\"font-size:18px;\"><span style=\"font-family:'times new roman', times, serif;\"><strong>Net Weight:&nbsp; </strong>250g<strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong><strong>Shelf Life:</strong> &nbsp; 18 months&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span> \n</p>\n<p>\n\t<span style=\"font-size:18px;\"><span style=\"font-family:'times new roman', times, serif;\"><strong>Package:&nbsp;</strong> bag<strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Place Of Origin: </strong>fujian,China</span></span> \n</p>\n<p>\n\t<span style=\"font-size:18px;\"><span style=\"font-family:'times new roman', times, serif;\"><strong>Storage: </strong>put in the dry, shady, ventilated, clean place</span></span> \n</p>\n<p>\n\t<span style=\"font-size:18px;\"><span style=\"font-family:'times new roman', times, serif;\"><strong>Health Benefits:</strong>&nbsp;&nbsp; Refreshing eliminate fatigue, fluid heat, diuretic, anti-inflammatory, detoxification, Warm stomach and so on</span></span> \n</p>\n<p>\n\t&nbsp;\n</p>\n<p>\n\t<span style=\"font-size:24px;\"><span style=\"font-family:'times new roman', times, serif;\"><strong><span style=\"color:#ffffff;\"><span style=\"background-color:#92d050;\">&nbsp;&nbsp; Product Display &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; </span></span></strong></span></span> \n</p>\n<p style=\"text-align:left;margin:0;\">\n\t<img src=\"https://wxalbum-10001658.image.myqcloud.com/wxalbum/38239/20181015210011/fb48750f0153a8e163a0c0775e4cf6e3.jpg\"><img src=\"https://wxalbum-10001658.image.myqcloud.com/wxalbum/38239/20181015210011/4e9dc79c57f7c0be80b2fbc1b8725173.jpg\"><img src=\"https://wxalbum-10001658.image.myqcloud.com/wxalbum/38239/20181015210011/1180365d452691785a7f39ec69ff7f6b.jpg\"><img src=\"https://wxalbum-10001658.image.myqcloud.com/wxalbum/38239/20181015210011/de1d57e068c947f06107b9cc961205cd.jpg\"> \n</p>\n<p>\n\t<br>\n</p>\n<p>\n\t<br>\n</p>\n<p>\n\t<span style=\"font-family:'times new roman', times, serif;\"><span style=\"font-size:20.0px;\"><span style=\"color:#ffffff;\"><strong><span style=\"background-color:#92d050;\">&nbsp;&nbsp; About Shipping And Freight&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></strong></span></span></span> \n</p>\n<p>\n\t<span style=\"font-family:'times new roman', times, serif;\"><span style=\"font-size:14.0px;\"> </span></span> \n</p>\n<p style=\"font-size:medium;white-space:normal;font-family:Arial;\">\n\t<span style=\"font-family:georgia, serif;\"><span style=\"font-size:14px;\"><strong><span style=\"font-size:18px;\">To USA.by&nbsp;<span style=\"color:#E53333;\">e-</span></span></strong><strong><span style=\"font-size:18px;\"><span style=\"color:#E53333;\">Packet</span>,15-35days for delivery.</span></strong><br>\n<strong><span style=\"font-size:18px;\">To other countries by<span style=\"color:#E53333;\">&nbsp;China Post Air Mail</span>&nbsp;, &nbsp;Shipping &nbsp;to worldwide,25-45 days for delivery</span></strong></span></span> \n</p>\n<span style=\"white-space:normal;font-family:georgia, serif;font-size:18px;\">Some country may delay 1-2&nbsp;weeks.</span></div>\n\t\t\t\t\t\t</td>\n\t</tr>\n</table><span id=\"closeHtml\"></span>\n<script type=\"text/javascript\">\r\n\t\tvar _rfr = '';\r\n\t</script>\r\n\t<script src=\"http://ir.ebaystatic.com/rs/v/1yzqmzxk3a3utciscis2t10n1uu.js\" type=\"text/javascript\"></script><img src='http://rover.ebay.com/roversync/?site=0&stg=1&mpt=1595060187898'></img>",
		"language_code": "en",
		"props_img": [],
		"sales": 0,
		"props_name": "",
		"shop_item": [],
		"relate_items": []
	},
	"secache": "095e76cb687f8fced47407ed0e0264b6",
	"secache_time": 1595060189,
	"secache_date": "2020-07-18 16:16:29",
	"translate_status": "ok",
	"translate_time": 0.002,
	"language": {
		"current_lang": "cn",
		"source_lang": "en"
	},
	"error": "",
	"reason": "",
	"error_code": "0000",
	"cache": 0,
	"api_info": "today: max:",
	"execution_time": 6.884,
	"server_time": "Beijing/2020-07-18 16:16:29",
	"call_args": {
		"num_iid": "331712743699"
	},
	"api_type": "ebay",
	"translate_language": "zh-CN",
	"translate_engine": "baidu",
	"server_memory": "3.01MB",
	"request_id": "15f12afd640bce"
}
### 抓取 eBay 商品描述的方法 抓取 eBay 商品描述可以通过多种方式实现,具体取决于需求和技术能力。以下是几种常见的方式及其适用场景: #### 方法一:使用 eBay 官方 API 接口 eBay 提供官方的 RESTful 和 SOAP API 来访问其商品数据。通过这些 API 可以合法地获取商品详情,包括但不限于标题、图片、价格以及完整的商品描述- 需要在 eBay 开放平台注册开发者账户,并创建应用程序以获得 `App Key` 和 `Secret`。 - 利用 eBay 的 Trading API 或者 Shopping API 发送 HTTP 请求来检索指定商品的信息[^2]。 ```python import requests def get_ebay_item_description(item_id, app_key): url = f"https://svcs.ebay.com/services/search/FindingService/v1" params = { 'OPERATION-NAME': 'findItemsById', 'SERVICE-VERSION': '1.0.0', 'SECURITY-APPNAME': app_key, 'RESPONSE-DATA-FORMAT': 'JSON', 'itemFilter(0).name': 'ListingType', 'itemFilter(0).value': 'FixedPrice', 'id': item_id } response = requests.get(url, params=params) data = response.json() description = data['searchResult']['item'][0]['listingInfo'].get('description', '') return description # 调用函数示例 app_key = "<您的 App Key>" item_id = "123456789" # 替换为目标商品ID print(get_ebay_item_description(item_id, app_key)) ``` 此代码片段展示了如何调用 eBay Finding Service 获取特定商品 ID 对应的商品描述信息。 --- #### 方法二:第三方服务提供商 如果不想自行开发基于 eBay API 的解决方案,则可以考虑采用一些成熟的第三方服务商所提供的工具和服务。它们通常封装好了复杂的逻辑流程,简化了用户的操作过程。 例如 OneBound 提供了一个简单的接口用于查询单个 eBay 物品的具体资料[^3]。只需提供有效的 API 密钥与目标物品编号即可快速取得所需字段值。 请求样例如下所示: ```bash curl -i "https://api-gw.onebound.cn/ebay/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=155160061798" ``` 注意替换 `<您自己的apiKey>` 和 `<您自己的apiSecret>` 成实际拥有的凭证字符串[^3]。 --- #### 方法三:网页爬虫技术 对于那些无法满足于公开 API 功能限制或者希望更灵活控制采集行为的人来说,编写自定义网络爬虫也是一种可行的选择。不过需要注意的是,在实施此类项目之前务必仔细阅读并遵循目标网站的服务条款以免触犯法律风险。 下面给出一段基础 Python 实现方案作为参考用途仅限学习交流,请勿滥用! ```python from bs4 import BeautifulSoup import requests def scrape_ebay_product_desc(product_url): headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'} page = requests.get(product_url, headers=headers) soup = BeautifulSoup(page.content, 'html.parser') desc_div = soup.find("div", {"class": "vi-desc"}) if desc_div is not None: product_desc = desc_div.text.strip() else: product_desc = "" return product_desc url = input("请输入要解析的产品链接:") desc_text = scrape_ebay_product_desc(url) if len(desc_text)>0 : print(f"\n产品描述如下:\n{desc_text}") else : print("\n未能成功提取到任何有效的内容.") ``` 该脚本利用 Beautiful Soup 库分析 HTML 文档结构从而定位至包含商品描述部分标签节点再读取出纯文本形式的结果[^1]。 --- ### 注意事项 无论采取哪种途径都应当尊重原始站点的规定并且合理规划频率避免给服务器带来过大压力造成不必要的麻烦。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值