Home  >  Article  >  Backend Development  >  求取到淘宝天猫商品的现价的方法。

求取到淘宝天猫商品的现价的方法。

WBOY
WBOYOriginal
2016-06-20 12:44:481293browse


这个现价我没有找到获取方法。就是49.00这个数。而不是128那个原价,原价很好获得。


求可以用的php代码。
功能:给出商品链接,获取到商品现价。

有一个从缓存取的方法(cache)就不要说了,那个方法我可以取到。


回复讨论(解决方案)

这个需要模拟来源。然后访问
页面中的
sibUrl           : '//detailskip.taobao.com/json/sib.htm?itemId=521455088477&sellerId=131286224&prior=1&p=1&rcid=50006843&sts=475598864,1170940491022204996,216524763307212928,1166502672237462531&price=98000&ju=true&vd=1&skil=false&st=1&pf=1&al=false&ap=0&ss=0&free=1&defaultCityId=110100&u=1&ct=1&ns=1', 

就可以了。
 type:  "秋冬新势力" ,
             price:"238.00",        limitTime: "",
        channelkey: "",
        add: "",
        gift: "",
        cart: "true",

这个需要模拟来源。然后访问
页面中的
sibUrl           : '//detailskip.taobao.com/json/sib.htm?itemId=521455088477&sellerId=131286224&prior=1&p=1&rcid=50006843&sts=475598864,1170940491022204996,216524763307212928,1166502672237462531&price=98000&ju=true&vd=1&skil=false&st=1&pf=1&al=false&ap=0&ss=0&free=1&defaultCityId=110100&u=1&ct=1&ns=1', 

就可以了。
 type:  "秋冬新势力" ,
             price:"238.00",        limitTime: "",
        channelkey: "",
        add: "",
        gift: "",
        cart: "true",



请问如果是天猫商品

https://detail.tmall.com/item.htm?spm=a3149.7799748.2574737280.6.7Uoknj&id=39609048064&acm=lb-zebra-26510-360367.1003.4.482085&scm=1003.4.lb-zebra-26510-360367.ITEM_39609048064_482085
去访问哪个网址呢?

这逗比楼主又来了。

https://detail.tmall.com/item.htm?id=商品id  自行爬、

第二种:

http://hws.m.taobao.com/cache/wdetail/5.0/?id=商品ID

返回json。

你知道这个cache是哪里的吗?是手机淘宝用的.为了严谨才跟你说有缓存的。事实上所有淘宝的商品数据都会缓存10-30分钟左右.

没看到 49 是过了一会才显示过来。 用到了JS,

你应该想到就是用了ajax异步请求啊。
你要的49在如下链接里面
URL:

https://detailskip.taobao.com/json/sib.htm?itemId=35300773790&sellerId=741012020&prior=1&p=1&rcid=50050359&sts=72945664,1170937191606517832,216525184214007936,13519607902111235&price=12800&vd=1&skil=false&st=1&pf=1&al=false&ap=1&ss=0&free=0&defaultCityId=110100&u=1&ct=1&sd=0

URL2


https://tui.taobao.com/recommend?_ksTS=1446710400616_770&callback=jsonp771&appid=1837&itemid=35300773790&count=5&style=h&types=view,buy,same

请教:

http://bbs.csdn.net/topics/391854288


谢谢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn