问题描述
我不是专家,但我正在尝试编写一个通用脚本,用于在存储在数据库中的某个网站上进行搜索,例如在数据库中存储ebay.com和amazon.com。
I am no expert, but I'm trying to write a universal script for searching on some website which is stored in a database, for example in the database is stored "ebay.com" and "amazon.com".
在我的网页上输入任何关键字(例如iphone)时,stript会发现:
When I type in on my webpage into a text box any keyword (for example "iphone"), the stript will find:
在ebay上:
http://www.ebay.com/sch/i.html?_trksid=p2050601.m570.l1313.TR9.TRC1.A0.Xiphone&_nkw=iphone&_sacat=0&_from=R40
在亚马逊:
On Amazon:
http://www.amazon.com/s/ref=nb_sb_noss_2/190-1864389-3911824?url=search-alias%3Daps&field-keywords=iphone
获得这个结果后,我想将它存储在一个数组中。
After getting this result I would like to store it in an array.
我需要这个脚本适用于每一个e-商店
And i need that this script will work for every e-shops
推荐答案
您可以使用Ebay和Amazon API。如果您查看文档,您将看到有些搜索功能可用。
You can use Ebay and Amazon APIs. If you check the documentation you will see that some search functions are available there.
Ebay的PHP和Javascript示例查找教程:
Ebay's finding tutorial with PHP and Javascript examples:
http://developer.ebay.com/Devzone/finding/HowTo/index.html
以及亚马逊的API参考
And Amazon's API reference
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CHAP_ApiReference.html
这篇关于搜索脚本,查找存储在数据库中的网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!