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

[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

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致
  • ¥15 禅道二次开发编辑版本,上传不了发行包