Comments (2)
是说要按时间顺序,先爬最早发布的再爬第二早发布的,以此类推,最后爬最新的微博吗?
如果是这样,思路大致这样:1.先爬最后一页微博,再爬倒是第二页,从后往前爬;2.对于每一页微博,先爬最后一条,再爬倒数第二条,以此类推。
get_weibo_info中的page用来控制爬取的页数,for page in range(1, page_num + 1)表示从第一页爬到最后一页,修改为for page in range(page_num , 0, -1);
for i in range(0, len(info) - 2)控制每页内从第一条爬到最后一条,修改为for i in range(len(info) - 3,-1, -1)即可。
from weibospider.
可以了,感谢🙂
from weibospider.
Related Issues (20)
- 系统中可能没有安装pymysql库,请先运行 pip install pymysql ,再运行程序 HOT 2
- 'NoneType' object has no attribute 'xpath'报错 HOT 5
- 爬取微博时只获取了前几页内容就自动停止了,提示'NoneType' object has no attribute 'xpath' HOT 3
- 更改page range后无法爬取微博 HOT 1
- 我是小白,想问一下我下载了代码zip之后怎么用啊? HOT 2
- 我是小白,想问一下我下载了代码zip之后怎么用啊? HOT 3
- 运行spider.py ,提示ImportError: attempted relative import with no known parent package,是为什么呢 HOT 2
- 请求商务推广合作 HOT 3
- cookie错误或已过期,请按照README中方法重新获取 HOT 4
- 可以爬访客记录吗? HOT 2
- 超话名人动态 HOT 2
- 请问能否增加爬自己微博的阅读数 HOT 5
- 通过用户 ID 删除图像链接 HOT 3
- 爬到1百多页还没有全部爬完时程序会自动结束 HOT 2
- cookie错误或已过期,请按照README中方法重新获取 HOT 1
- 可以添加一个获取阅读量选项吗? HOT 2
- 配置了mysql,但是似乎没有创建任何database,也没有写任何数据到mysql HOT 1
- 如果该UID没有新的内容,会重复在csv和txt文件中记录重复的title HOT 1
- 当前账号没有浏览该视频的权限
- 我想请问就是这个'X-Xsrf-Token': 'a62fb7'过期导致不能获得评论,还是说这个代码本来就是运行不通的 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weibospider.