0
我能夠獲得75,000個數。之後,它不斷拉取重複的ID。這是我的代碼。我能否得到任何建議,以便我可以正確拉取大量跟隨者ID而不重複?使用python獲得超過700k的關注者ID使用Python
import tweepy
import time
access_token = "..."
access_token_secret = "..."
consumer_key = "..."
consumer_secret = "..."
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
ids = []
while True:
try:
for page in tweepy.Cursor(api.followers_ids, screen_name = "...").pages():
ids.extend(page)
except tweepy.TweepError:
time.sleep(60*15)
continue
except StopIteration:
pass
break
我試着與一對夫婦數百追隨者的做同樣的在一些Twitter賬戶,並沒有能夠重現 – glls