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

COOKIES没有失效,但是Progress:  19%就结束了,可能是什么原因? #426

Open
wendywjhu opened this issue Apr 3, 2024 · 3 comments

Comments

@wendywjhu
Copy link

首先,我加了COOKIE,Progress:  19%,跑到8000多条的时候,就爬取完成了。此时我怀疑是cookie失效了,然后我立即重新去检查了一下cookie,发现测试是成功的。请问目前爬不全的问题可能是什么其它原因? 谢谢!

日志信息如下:Progress:  19%就结束了

------------------------------已获取王盐Charles(5659598386)的第918页微博------------------------------

Progress:  19%|████▊                     | 918/4922 [1:20:13<5:49:55,  5.24s/it]

8933条微博写入MySQL数据库完毕

微博爬取完成,共爬取8933条微博

信息抓取完毕

日志信息如下:验证COOKIE是有效的
image

@dataabc
Copy link
Owner

dataabc commented Apr 3, 2024

有可能是since_date满足停止要求了,比如你设置获取今年的微博,今年之前的就不会获取,停止运行。百分百是全部微博的获取比例,不是停止条件。

@ShuyuanShen
Copy link

我也是跑到8000多条的时候,爬取自动结束了。since_data设置的是2010-01-01,并没有满足。8000多条只收集到2023年7月。cookie也没有失效。是不是微博爬取一个账户的总量有限制?单一账户最高纪录爬多少条?谢谢。

@wendywjhu
Copy link
Author

我也是跑到8000多条的时候,爬取自动结束了。since_data设置的是2010-01-01,并没有满足。8000多条只收集到2023年7月。cookie也没有失效。是不是微博爬取一个账户的总量有限制?单一账户最高纪录爬多少条?谢谢。

原因应该是微博平台官方限流导致的。我后来是这样解决的:跑断之后,观察日志跑到了哪一页,从那一页再次开始跑即可。

for page in tqdm(pages, desc="Progress"):
# huwenjing begin
if page < 4781:
continue
# huwenjing end

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

3 participants