我用西刺代理上面爬取的https代理去请求http页面时候是正常返回的,去请求https页面却提示无法连接(requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.jd.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02C39E70>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))))
headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36'}#构造头部 url="http://www.xicidaili.com/wn/" html=requests.get(url,headers=headers).content#get中提交url,headers print html