host=‘api.github.com‘, port=443): Max retries exceeded with url

python写爬虫报错

host='api.github.com', port=443): Max retries exceeded with url

 

解决方法,在

requests.get(url, headers=headers)

前,

添加如下代码

# 解决“Max retries exceeded with url”问题
s = requests.session()
s.keep_alive = False
上一篇:Pycharm requests requests.exceptions.SSLError: HTTPSConnectionPool(host='xx.com.cn', port=


下一篇:Android 获取联系人手机号码、姓名、地址、公司、邮箱、生日