我是相当新的tweepy和使用光标类分页。 我一直在试图用户将光标类来获得一个特定的Twitter用户的所有追随者,但它说,我不断收到错误"tweepy.error.TweepError: This method does not perform pagination"
因此,我会很感激,如果任何帮助有人可以帮我实现获得与分页特定的Twitter用户的所有追随者,使用tweepy的这个任务。 我到目前为止的代码如下:
import tweepy
consumer_key='xyz'
consumer_secret='xyz'
access_token='abc'
access_token_secret='def'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
user = api.get_user('somehandle')
print user.name
followers = tweepy.Cursor(user.followers)
temp=[]
for user in followers.items():
temp.append(user)
print temp
#the following part works fine but that is without pagination so I will be able to retrieve at #most 100 followers
aDict = user.followers()
for friend in aDict:
friendDict = friend.__getstate__()
print friendDict['screen_name']