Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,如果要先爬最早发布的微博怎么办? #43

Closed
leqiang222 opened this issue Feb 26, 2019 · 2 comments
Closed

你好,如果要先爬最早发布的微博怎么办? #43

leqiang222 opened this issue Feb 26, 2019 · 2 comments

Comments

@leqiang222
Copy link

No description provided.

@dataabc
Copy link
Owner

dataabc commented Feb 26, 2019

是说要按时间顺序,先爬最早发布的再爬第二早发布的,以此类推,最后爬最新的微博吗?
如果是这样,思路大致这样: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)即可。

@leqiang222
Copy link
Author

可以了,感谢🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants