alanzhy 2021-06-10 14:18 采纳率: 0%
浏览 954

[SSL: WRONG_VERSION_NUMBER]

proxies={'http':'http://127.0.0.1:8080'}
res=requests.get('https://699pic.com/sousuo-218808-13-1-0-0-0.html',verify=False,proxies=proxies)

IE设置了代理,代码执行结果报了错

ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='699pic.com', port=443): Max retries exceeded with url: /sousuo-218808-13-1-0-0-0.html (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))

requests.exceptions.SSLError: HTTPSConnectionPool(host='699pic.com', port=443): Max retries exceeded with url: /sousuo-218808-13-1-0-0-0.html (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))

  • 写回答

2条回答 默认 最新

  • alanzhy 2021-06-10 16:48
    关注

    算是找到答案了。

    proxies={'http':'http://127.0.0.1:8080'}

    改为

    proxies={'https':'http://127.0.0.1:8080'}

    执行成功

    抛出警告:Program Files\Python3.9\lib\site-packages\urllib3\connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
      warnings.warn(

    直接忽略警告

    import urllib3
    urllib3.disable_warnings()

    原文地址:https://stackoverflow.com/questions/14390605/python-requests-ssl-issue

    评论

报告相同问题?

悬赏问题

  • ¥20 三极管1000倍放大电路
  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
  • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术