当前位置:首页 > python > 正文内容

python用requests发送模拟请求忽略https的认证,忽略警告

root5年前 (2021-06-10)python3043

import warnings warnings.filterwarnings('ignore')

在文件头添加

忽略警告信息的输出



r = requests.get('https://kyfw.12306.cn',verify=False) 

请求中添加参数verify=False

忽略https的认证


https://blog.csdn.net/xiaodongxiexie/article/details/65646239

https://blog.csdn.net/weixin_28862561/article/details/112964058


扫描二维码推送至手机访问。

版权声明:本文由一叶知秋发布,如需转载请注明出处。

本文链接:https://zhiqiu.top/?id=123

分享给朋友:

相关文章

Popen 使用注意(python)

Popen 的构造函数可以尝试指定一下 close_fds = True意思是不继承主线程的上下文件因为Popen在启动一个进程时容易出现僵尸进程,当主进程死亡时可能会继承主进程的上下文资源...

python 在centos 执行pip安装包时最好提前执行的语句

yum install python-develpip install --upgrade setuptoolspip install --upgrade pi...

自定义logger 模块使调用打印日志的文件为调用文件而不是logger模块

更新logging 源码1248行f f f.f_back替换为f f f.f_back     f_2 f.f_back   ...

python os 模块文件常用操作

123456import os #回去当前文件路径os.path.realpath(__file__)#获取文件是否存在os.path.exists(filepath)#获取文件大小os.path.getsize(fil...

python 的configparser 读取配置文件遇到%特殊符号

test.ini 配置文件中有mysql的密码,且密码含有“%”这个特殊符号因为%在py是转义符的含义需要对该字符转义即修改  %  为 %%用%对%进行转义...

selenium控制webdriver  设置请求头。只能设置简单的。自定义和固定的格式无法修改成功

selenium控制webdriver 设置请求头。只能设置简单的。自定义和固定的格式无法修改成功

time selenium webdriver options webdriver.() options.() options.( options.() browser webdriver....