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

[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

    评论

报告相同问题?