1、分析网站
打开开发者工具,我们观察到排行榜的数据并没有在doc里
![](http://upload-images.jianshu.io/upload_images/1531909-fe1ba117208807af.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
doc文档
在Javascript里我么可以看到下面代码:
![](http://upload-images.jianshu.io/upload_images/1531909-9da33ce8aee85d5f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
ajax的post方法异步请求数据
在 XHR一栏里,我们找到所请求的数据
![](http://upload-images.jianshu.io/upload_images/1531909-3b008fa3457c3d63.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
json存储的数据
请求字段为:
![](http://upload-images.jianshu.io/upload_images/1531909-218c4ce65e22c66d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
post请求字段
2、伪装浏览器,并将json数据存入excel里面
![](http://upload-images.jianshu.io/upload_images/1531909-991c57a01697324e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
获取信息
![](http://upload-images.jianshu.io/upload_images/1531909-df5ce55e9fceb13a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
将数据保存到excel中
3、结果展示
![](http://upload-images.jianshu.io/upload_images/1531909-0ad9e042291b60a8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
学习过程中遇到什么问题或者想获取学习资源的话,欢迎加入学习交流群
626062078,我们一起学Python!