requests使用代理出错
requests.exceptions.ProxyError: HTTPSConnectionPool(host='play.google.com', port=443): Max retries exceeded with url: (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response',)))
源代码
import requests, os
# os.environ['NO_PROXY'] = 'play.google.com'
entry = '**********
headers = {"content-type": "application/x-www-form-urlencoded",'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36'}
proxies = {
"http": entry,
"https": entry,
}
# verify=False allow_redirects=False
r = requests.get("*********", headers=headers, proxies=proxies
)
print(f"Response status: {r.status_code}")
print(f"Content:{r.content}")