python 解决警告提示

0..abb=requests.post(url,headers=head1,data=aw) 会出现下面的错误提示:

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.。。。。.com', port=443): Max retries exceeded with url: /login.php (Caused by SLError(SSLCertVerificationError("hostname 'www.。。。.com'

上面提示解决方法:.abb=requests.post(url,headers=head1,data=aw,verify=False) 

1.出现新的警告提示

Warning (from warnings module):
File "C:\python37\lib\site-packages\urllib3\connectionpool.py", line 1020
InsecureRequestWarning,
InsecureRequestWarning: Unverified HTTPS request is being made to host 'www.。。。.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings

2.abb=requests.post(url,headers=head1,data=aw,verify=False)  #造成的

解决方法:

import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

即可

 

posted @ 2022-04-04 22:04  myrj  阅读(461)  评论(0编辑  收藏  举报