We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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_list,但是为了节约时间我不需要把他们的关注列表全都爬下来,只想要随机获取每个id关注的10个人,或者可以指定是他们关注列表里每一页的前2个人。请问可以怎样通过修改代码实现呢? 谢谢您!
The text was updated successfully, but these errors were encountered:
有两个方法可能有用,get_follow_list和get_one_page。
get_follow_list控制某一用户关注的进度,首先它获取该用户一共有多少页关注列表,然后再调用get_one_page,依次获取每页的用户信息。get_one_page就是获取关注页的用户信息的,table_list包括某一关注页的用户信息,大约有10个,如果你想保存前2人,可以在循环中计数,等于2人即停止循环。或者在get_one_page计算self.follow_list的长度,满足10就停止,这样就使每个用户尽量获取10个关注。
如果还有问题,欢迎继续讨论
Sorry, something went wrong.
No branches or pull requests
您好,请问,如果我有一个很长的user_id_list,但是为了节约时间我不需要把他们的关注列表全都爬下来,只想要随机获取每个id关注的10个人,或者可以指定是他们关注列表里每一页的前2个人。请问可以怎样通过修改代码实现呢?
谢谢您!
The text was updated successfully, but these errors were encountered: