【问题标题】:Tweepy get date user created twitter accountTweepy 获取用户创建 Twitter 帐户的日期
【发布时间】:2021-05-26 07:44:25
【问题描述】:

我尝试使用 Tweepy 从 Twitter 获取数据,但是当我想获取用户创建 Twitter 帐户时的日期时遇到了问题。

【问题讨论】:

    标签: twitter tweepy


    【解决方案1】:

    设置您的 twitter oauth 然后使用 JSON 原始解析器

    api = tweepy.API(auth_handler=auth, parser=tweepy.parsers.JSONParser())
    user_data = api.get_user(screen_name) 
    

    在你获得的数据上,你会看到user_data['created_at']

    【讨论】:

      【解决方案2】:
      auth = OAuthHandler(ckey, csecret)
      auth.set_access_token(atoken, asecret)
      api = API(auth)
      
      print 'Getting statistics for @user:'
      
      # Get information about the user
      data = api.get_user('user')
      print str(data.created_at)
      

      希望有帮助:)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-03-07
        • 2020-12-19
        • 2021-04-14
        • 1970-01-01
        • 2019-06-14
        • 2020-05-31
        • 2023-03-17
        相关资源
        最近更新 更多