The best way to get a list of followers in Python with Tweepy

回眸只為那壹抹淺笑 提交于 2019-11-29 17:46:54

问题


Is there a better way to get a list of followers screen names with Tweepy than this:

for follower in api.followers_ids('twitter'):
    print api.get_user(follower).screen_name

回答1:


I think this is more efficient:

for user in tweepy.Cursor(api.followers, screen_name="twitter").items():
    print user.screen_name

FYI, it uses followers/list twitter API call.



来源:https://stackoverflow.com/questions/17455107/the-best-way-to-get-a-list-of-followers-in-python-with-tweepy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!