@Loler100

Почему не работает proxy в python requests?

Не работает прокси в python requests. Выводит ошибки:
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997) 
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ramziv.com', port=443): Max retries exceeded with url: /ip (Caused by ProxyError('Your proxy appears to only use HTTP and not HTTPS, try changing your proxy URL to be HTTP. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#https-proxy-error-http-proxy', SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))))
requests.exceptions.ProxyError: HTTPSConnectionPool(host='ramziv.com', port=443): Max retries exceeded with url: /ip (Caused by ProxyError('Your proxy appears to only use HTTP and not HTTPS, try changing your proxy URL to be HTTP. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#https-proxy-error-http-proxy', SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))))

Решения по поводу SSL не подходят. Код:
for i in range(0, count):

    proxy = {
        'http': http[i],
        'https': https[i]
    }

    print(f'Domain: {domain}')
    print(proxy)

    response = requests.get(domain, verify=False, proxies=proxy)
    print(response.text)
  • Вопрос задан
  • 5187 просмотров
Пригласить эксперта
Ответы на вопрос 1
ValdikSS
@ValdikSS
Потому что HTTPS-прокси — не то, что вы думаете, а Secure Web Proxy (HTTP-прокси с TLS поверх), что, наиболее вероятно, ваш прокси-сервер не поддерживает.

Убедитесь, что у вас протокол прокси везде указан как 'http', а не 'https'.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы