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

如何批量获取带某一关键词的所有微博用户的user id #640

Open
Daisy-pink opened this issue Feb 24, 2025 · 4 comments
Open
Labels
feature 新需求

Comments

@Daisy-pink
Copy link

Daisy-pink commented Feb 24, 2025

大佬你好,我想问一下怎么能批量获取带某一关键词的所有微博用户的id呢,例如所有带“字幕组”的微博用户的id。我尝试用weibo_follower的方法修改代码,但是因为自己刚学python,还不太会编码,对我来说太难了,非常感谢。

还有一个问题是,我用weibo_crawler抓取一个id的用户信息,也加了自己的cookies,为什么有的信息缺失呢,比如生日,所在地,注册时间这些都没有。

非常感谢您。

@Daisy-pink Daisy-pink added the feature 新需求 label Feb 24, 2025
@dataabc
Copy link
Owner

dataabc commented Feb 25, 2025

感谢反馈,你可以参考我的weibo-search项目,它就是微博关键词搜索,只是没有用户id,需要自己修改search.py。
部分信息 缺失是因为你可能没有使用有效cookie,或者用户没有添加这些信息。

@Daisy-pink
Copy link
Author

感谢反馈,你可以参考我的weibo-search项目,它就是微博关键词搜索,只是没有用户id,需要自己修改search.py。 部分信息 缺失是因为你可能没有使用有效cookie,或者用户没有添加这些信息。

谢谢。cookie我是按照您说的方法登陆自己的微博账号后获取的,这就是有效cookie吧,我爬取了两个用户,他们的profile info里都是有这些信息的。不知道是哪里出了错误

@dataabc
Copy link
Owner

dataabc commented Feb 26, 2025

如果这样,可能是网页结构改变导致获取失败,我现在不方便调试,您可以尝试修改weibo.py。

@Daisy-pink
Copy link
Author

如果这样,可能是网页结构改变导致获取失败,我现在不方便调试,您可以尝试修改weibo.py。

我找到问题啦,就是cookie的原因,我替换掉了原来的cookie,其他用户信息就爬取出来了,感谢大佬:)

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

No branches or pull requests

2 participants