HTTPSConnectionPool(host='www.sina.com.cn', port=443): Max retries exceeded with url: / (Caused by S

报错:

HTTPSConnectionPool(host='www.sina.com.cn', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

原因:

1、开了Filder之类的抓包工具;

2、使用了ip代理。

解决:

1.关闭抓包工具;

2.在请求参数中设置代理为(verify= False):

requests.get('http://www.sina.com.cn',params=None,headers=headers,verify=False)

你可能感兴趣的:(Python)