码迷,mamicode.com
首页 > 编程语言 > 详细

Python 爬虫知识点 - 淘宝商品检索结果抓包分析(续)

时间:2016-12-16 01:38:02      阅读:894      评论:0      收藏:0      [点我收藏+]

标签:url   规律   同步   ajax   src   iat   image   后台   c程序   

通过前一节得出地址可能的构建规律,如下:

https://s.taobao.com/search?data-key=s&data-value=44&ajax=true&_ksTS=1481814489094_902&callback=jsonp903&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=3&ntoffset=0&p4ppushleft=1%2C48

https://s.taobao.com/search?data-key=s&data-value=88&ajax=true&_ksTS=1481814530312_1045&callback=jsonp1046&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=0&ntoffset=6&p4ppushleft=1%2C48&s=44

https://s.taobao.com/search?data-key=s&data-value=132&ajax=true&_ksTS=1481816198100_1326&callback=jsonp1327&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-3&ntoffset=3&p4ppushleft=1%2C48&s=88

https://s.taobao.com/search?data-key=s&data-value=176&ajax=true&_ksTS=1481816618010_1533&callback=jsonp1534&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-6&ntoffset=0&p4ppushleft=1%2C48&s=132


https://s.taobao.com/search?data-key=s&data-value=176&ajax=true&_ksTS=1481817378403_2108&callback=jsonp2109&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-6&ntoffset=-6&p4ppushleft=1%2C48&s=132

https://s.taobao.com/search?data-key=s&data-value=176&ajax=true&_ksTS=1481817378403_2108&callback=jsonp2109&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-6&ntoffset=-6&p4ppushleft=1%2C48&s=132

https://s.taobao.com/search?data-key=s&data-value=176&ajax=true&_ksTS=1481817378403_2108&callback=jsonp2109&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-6&ntoffset=-6&p4ppushleft=1%2C48&s=132


https://s.taobao.com/search?data-key=s&data-value=220&ajax=true&_ksTS=1481816618010_1533&callback=jsonp1534&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-6&ntoffset=-6&p4ppushleft=1%2C48&s=176


https://s.taobao.com/search?data-key=s&data-value=264&ajax=true&_ksTS=1481818506324_2454&callback=jsonp2455&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-9&ntoffset=-3&p4ppushleft=1%2C48&s=220

https://s.taobao.com/search?data-key=s&data-value=264&ajax=true&_ksTS=1481818506324_2454&callback=jsonp2455&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-9&ntoffset=-3&p4ppushleft=1%2C48&s=220

 

但是从浏览器者开发工具中,拷贝出来的URL,放在浏览器中,刷新后,同样的URL,而结果确实变化的,为什么???同时打开两次,返回的数据是变化的?初步判断可能是后台搜索服务器中对于bcoffset=-9&ntoffset=-3&p4ppushleft=1等参数做了偏移处理,这是不是由于后台搜索机制引起的了???

URL是:https://s.taobao.com/search?data-key=s&data-value=264&ajax=true&_ksTS=1481818506324_2454&callback=jsonp2455&q=Python%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0&imgfile=&js=1&stats_click=search_radio_all%3A1&initiative_id=staobaoz_20161215&ie=utf8&bcoffset=-9&ntoffset=-3&p4ppushleft=1%2C48&s=220

 

技术分享

 

技术分享

 

 

 更为紧张的事情,本来关键词是Python机器学习,结果搜索的结果是:全套2本2016秋期末冲刺100分二年级上完全试卷 二年级上 数学语文2年级全2本2年级上册人教版RJ小学生同步练习卷期中期末测试卷搭,正版【全2册】C程序设计语言//计算机科学丛书(第2版新版) 第二版 教材+习题详解 媲美谭浩强 the c programming language 克尼汉等。为什么会是这样的结果了?

技术分享

 

 

 

可能解释的结果是:淘宝禁止爬取通过搜索框输入返回的结果列表???对参数做了特殊处理???有谁知道这样的规律了?仅仅是为了学习抓包分析和爬虫技术,不做他用。

 

Python 爬虫知识点 - 淘宝商品检索结果抓包分析(续)

标签:url   规律   同步   ajax   src   iat   image   后台   c程序   

原文地址:http://www.cnblogs.com/defineconst/p/6185396.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!