在python中使用请求时无法获得本地颁发者证书

Unable to get local issuer certificate when using requests in python

这是我的密码

1
2
3
4
5
6
7
8
9
10
import requests;
url='that website';
headers={
  'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
  'Accept-Language':'zh-CN,zh;q=0.9,en;q=0.8,ja;q=0.7',
  'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
};
r = requests.get(url,headers=headers);
print(r);
print(r.status_code);

然后它遇到了:

requests.exceptions.SSLError:
HTTPSConnectionPool(host='www.xxxxxx.com', port=44 3): Max retries
exceeded with url: xxxxxxxx (Caused by SSLEr
ror(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate
(_ssl.c:1045)')))

我该怎么办?


修复:快,快,快 </P >

requests.get('https://example.com', verify=False) </P >

希望helpful。。。。。。。 </P >