【问题标题】:I am trying to access some twitter user id's using api.lookup_user , but when i run this , i get tweeperror我正在尝试使用 api.lookup_user 访问一些 twitter 用户 ID,但是当我运行它时,我得到 tweeperror
【发布时间】:2021-02-03 14:42:36
【问题描述】:

我正在尝试使用 api.lookup_users 从 Twitter API 访问一些用户信息。当我运行以下代码时出现此错误。


import tweepy 

consumer_key = "" 
consumer_secret = "" 
access_token = "" 
access_token_secret = "" 
   
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) 
   
auth.set_access_token(access_token, access_token_secret) 
  
api = tweepy.API(auth) 
user_ids = [57741058, 4802800777, 1037141442] 
  
users = api.lookup_users(user_ids)

TweepError: 发送请求失败:HTTPSConnectionPool(host='api.twitter.com', port=443): url: /1.1/users/lookup.json?user_id=572332655397629952%2C551659627872415744 超过了最大重试次数(由SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1123)'))

【问题讨论】:

    标签: python api twitterapi-python


    【解决方案1】:

    正如您在错误中看到的,这是 SSL 故障。 检查此link 了解更多信息。 this 也可能有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-17
      • 1970-01-01
      • 2021-09-05
      • 2014-07-06
      • 2020-01-28
      相关资源
      最近更新 更多