pycharm fiddler requests.exceptions.SSLError

一、SSL问题
1.不启用fiddler,直接发https请求,不会有SSL问题(也就是说不想看到SSL问题,关掉fiddler就行)

2.启动fiddler抓包,会出现这个错误:requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

二、verify参数设置
1.Requests的请求默认verify=True
2.如果你将 verify设置为 False,Requests 也能忽略对 SSL 证书的验证
3.但是依然会出现两行Warning,可以不用管

三、忽略Warning
1.有些小伙伴有强迫症看到红色的心里就发慌,这里加两行代码可以忽略掉警告,眼不见为净!

2.参考代码:用红色的几段代码就可以搞定这个问题!

# coding:utf-8
import requests
# 禁用安全请求警告
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
url = "https://passport.cnblogs.com/user/signin"
headers = {
     "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0"
          }
r = requests.get(url, headers=headers, verify=False)
print(r.status_code)

原文地址:https://www.cnblogs.com/itfat/p/9374739.html

时间: 2024-11-05 13:43:18

pycharm fiddler requests.exceptions.SSLError的相关文章

python使用requests时报错requests.exceptions.SSLError: HTTPSConnectionPool

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.baidu.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),)) 错误提示就是上面这样的.首先我找了很多的资料,

requests.exceptions.SSLError……Max retries exceeded with url错误求助!!!

import requests head = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36", "Connection": "close"} html = requests.get("https://fa

requests.exceptions.SSLError: HTTPSConnectionPool报错解决方案

运行脚本报错: Traceback (most recent call last): File "F:/Interface_Study/study_requests/auto_get_post.py", line 24, in <module> res = Calendar_Query().request_main(url,'get',data) File "F:/Interface_Study/study_requests/auto_get_post.py&qu

解决python爬虫requests.exceptions.SSLError: HTTPSConnectionPool(host=&#39;XXX&#39;, port=443)问题

爬虫时报错如下: requests.exceptions.SSLError: HTTPSConnectionPool(host='某某某网站', port=443): Max retries exceeded with url: /login/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify fail

python:接口请求中出现requests.exceptions.SSLError 和 InsecureRequestWarning的解决办法

1.在请求中加入verify=False,关闭认证---------解决requests.exceptions.SSLError 2.添加代码----------- 解决InsecureRequestWarning import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) 原文地址:https://www.cnblogs.com/erchun/p/12653525.html

python 访问网站时报错:requests.exceptions.SSLError: HTTPSConnectionPool

解决该错误的正确姿势是更新pyOpenSSL库.输入命令: 1 pip install pyopenssl 参见: https://github.com/requests/requests/issues/4246 原文地址:https://www.cnblogs.com/mcgill0217/p/10357003.html

python requests.exceptions.ConnectionError

今天遇到一个奇葩问题, 1.r.request.post(url) 2..print r. status_code 居然第一步就报错了,原因是url不正确,按道理应该可以走到第二步然后输入404的 import requests try: requests.get("http://not.a.real.url/really_not") except requests.exceptions.ConnectionError as e: pass >>> e Connect

requests.exceptions.MissingSchema

requests.exceptions.MissingSchema: Invalid URL '//p9.pstatp.com/list/pgc-image/1538380201743a84869e0b6': No schema supplied. Perhaps you meant http:////p9.pstatp.com/list/pgc-image/1538380201743a84869e0b6? 碰到这个问题的地方来源:爬取今日头条图片 报错写法: response = reques

Ubuntu18.04 virutalenv报错:pip._vendor.requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.

使用virtualenv创建不同环境时,始终大面积报错,其中最重要的一行是: pip._vendor.requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. 大概报错如下: 其实很简单,虽然我有梯子,但是没有配置在terminal中配置好,只要设置为自己的代理即可: export all_proxy="https://127.0.0.1:1080/" 原文地址:https://www.cnbl