import requests
import requests.auth
requests.DEFAULT_RETRIES = 5
s = requests.session()
s.keep_alive = False
client_auth = requests.auth.HTTPBasicAuth('bnnn,'.....')
post_data = {"grant_type": "password", "username": ".....", "password": "....."}
headers = {"User-Agent": "....."}
response = requests.post("http://www.reddit.com/api/v1/access_token", auth=client_auth, data=post_data, headers=headers, verify=False)
print(response.json())
完整报错是:
requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.reddit.com', port=443): Max retries exceeded with url: /api/v1/access_token (Caused by ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory')))
纯小白提问~根据错误类型把网上能搜到的解决方法都试了个遍,为什么还是不行呀(像现在焦急崩溃),求好心人指点,感激不尽!
不知道你这个问题是否已经解决, 如果还没有解决的话: