【python】python运行脚本出现InsecureRequestWarning:Unverified HTTPS request is being made to host错误

【python】python运行脚本出现InsecureRequestWarning:Unverified HTTPS request is being made to host错误,第1张

【python】python运行脚本出现InsecureRequestWarning:Unverified HTTPS request is being made to host错误 问题原因

大概意思就是没有正在向主机发出未经验证的 HTTPS 请求 ,所以需要关闭校验

解决流程

添加
requests.packages.urllib3.disable_warnings()
verify=False

 proxies = {
        "http": None,
        "https": None,
    }
    header = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.40 Safari/537.36 Edg/87.0.664.24'
    }
    requests.packages.urllib3.disable_warnings()
    page_text = requests.post(url,headers=header,verify=False,proxies=proxies).content

个人网站:沉默博客
如有错误,请多多指教
如对你有帮助,给个赞吧。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5721374.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-18
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存