python爬虫报错!Caused by ProxyError

想利用botometer来测试机器人账号,这是我的代码,从官档下载的:

import botometer

rapidapi_key = "9d69e3bcffmshac93fcc436e647ap15edf5jsnd6649d05711c"
twitter_app_auth = {
    'consumer_key': '·············',
    'consumer_secret': '·················',
    'access_token':'·······················',
    'access_token_secret':'······························'
  }


bom = botometer.Botometer(wait_on_ratelimit=True,
                          rapidapi_key=rapidapi_key,
                          **twitter_app_auth)

# Check a single account by screen name
result = bom.check_account('@Hog8oy')

'''
# Check a single account by id
result = bom.check_account(1548959833)

# Check a sequence of accounts
accounts = ['@clayadavis', '@onurvarol', '@jabawack']
for screen_name, result in bom.check_accounts_in(accounts):
    # Do stuff with `screen_name` and `result`
'''

print(result)

 

 

但是在运行过后出现了这个问题,查了半天也没有头绪:

tweepy.error.TweepError: Failed to send request: HTTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url: /1.1/statuses/user_timeline.json?id=%40Hog8oy&include_rts=True&count=200 (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1106: The handshake operation timed out')))

 

请大家帮忙!谢谢!

可能是网络代理问题,api.twitter.com,确定这个接口可以往访问吗?如果不能,就会出现这个错误。

您好,我是有问必答小助手,你的问题已经有小伙伴为您解答了问题,您看下是否解决了您的问题,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632