小编mat*_*axu的帖子

如何获得大量关注者Tweepy

我正在尝试使用Tweepy从500k粉丝的帐户中获取完整的关注者列表,并且我有一个代码可以为我提供较小帐户的用户名,例如100以下,但如果我得到一个甚至像110粉丝的用户名,它不起作用.任何有助于确定如何使用更大数字的帮助非常感谢!

这是我现在的代码:

import tweepy
import time

key1 = "..."
key2 = "..."
key3 = "..."
key4 = "..."

accountvar = raw_input("Account name: ")

auth = tweepy.OAuthHandler(key1, key2)
auth.set_access_token(key3, key4)

api = tweepy.API(auth)

ids = []
for page in tweepy.Cursor(api.followers_ids, screen_name=accountvar).pages():
     ids.extend(page)
     time.sleep(60)

users = api.lookup_users(user_ids=ids)
for u in users:
     print u.screen_name
Run Code Online (Sandbox Code Playgroud)

我一直得到的错误是:

Traceback (most recent call last):
  File "test.py", line 24, in <module>
    users = api.lookup_users(user_ids=ids)
  File "/Library/Python/2.7/site-packages/tweepy/api.py", line 321, in lookup_users
    return self._lookup_users(post_data=post_data)
  File "/Library/Python/2.7/site-packages/tweepy/binder.py", line 239, in _call …
Run Code Online (Sandbox Code Playgroud)

python twitter tweepy

2
推荐指数
4
解决办法
7977
查看次数

标签 统计

python ×1

tweepy ×1

twitter ×1