使用 Tweepy 在 Python 中获取关注者列表的最佳方法 [英] The best way to get a list of followers in Python with Tweepy

查看:23
本文介绍了使用 Tweepy 在 Python 中获取关注者列表的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有比这更好的方法来使用 Tweepy 获取关注者屏幕名称列表:

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

推荐答案

我觉得这样更有效率:

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

仅供参考,它使用 followers/list twitter API 调用.

FYI, it uses followers/list twitter API call.

这篇关于使用 Tweepy 在 Python 中获取关注者列表的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆