【问题标题】:The best way to get a list of followers in Python with Tweepy使用 Tweepy 在 Python 中获取关注者列表的最佳方法
【发布时间】:2013-07-01 13:30:54
【问题描述】:

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

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

【问题讨论】:

    标签: python twitter tweepy


    【解决方案1】:

    我认为这样更有效率:

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

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

    【讨论】:

    • 我得到“AttributeError: 'API' object has no attribute 'followers'”当试图使用这个代码sn-p时。
    • 您使用的是什么tweepy 版本?直接从 github 安装最新的tweepy 版本。
    • 伙计们,这些不适用于 600K 或 1MM 之类的追随者人数......如何提取这么多追随者 ID?有人真的知道吗?
    • @dave 不,对于超过 5000 个名称的每个请求,您必须等待 60 秒
    猜你喜欢
    • 2019-02-26
    • 2021-04-14
    • 2023-03-16
    • 1970-01-01
    • 2016-02-04
    • 1970-01-01
    • 2015-07-03
    • 2021-02-27
    • 2021-04-14
    相关资源
    最近更新 更多