Не работают прокси с selenium и requests

Всем привет. Я пытаюсь использовать прокси, но почему-то запрос отправляется от моего айпи. Если через https то ошибка:

Traceback (most recent call last): File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\connection.py", line 198, in _new_conn sock = connection.create_connection( File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "C:\Users\samov\AppData\Local\Programs\Python\Python39\lib\socket.py", line 954, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\connectionpool.py", line 779, in urlopen self._prepare_proxy(conn) File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\connectionpool.py", line 1048, in _prepare_proxy conn.connect() File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\connection.py", line 616, in connect self.sock = sock = self._new_conn() File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\connection.py", line 205, in _new_conn raise NameResolutionError(self.host, self, e) from e urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x00000194FBBCE970>: Failed to resolve 'https' ([Errno 11001] getaddrinfo failed) The above exception was the direct cause of the following exception: urllib3.exceptions.ProxyError: ('Unable to connect to proxy', NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x00000194FBBCE970>: Failed to resolve 'https' ([Errno 11001] getaddrinfo failed)")) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen retries = retries.increment( File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\urllib3\util\retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x00000194FBBCE970>: Failed to resolve 'https' ([Errno 11001] getaddrinfo failed)"))) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "C:\Users\samov\OneDrive\Документы\DELIHERB\venv\lib\site-packages\requests\adapters.py", line 513, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: / (Caused by ProxyError('Unable to connect to proxy', NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x00000194FBBCE970>: Failed to resolve 'https' ([Errno 11001] getaddrinfo failed)")))

Вот код когда пытаюсь без https:

response = requests.request(
        'get',
        'https://api.ipify.org',
        proxies={'https': f'http//user125167:[email protected]:8584'},
        timeout=5,
        verify=False
    )
    my_ip = response.text

    print(f"Мой IP-адрес: {my_ip}")

Так же я пробовал через сессии и через selenium о у меня ничего не получилось. Прокси работают если использовать их в антидетект браузере. Версии: python 3.9 requests 2.31.0

Я писал везде и по разному протоколы и ничего не поменялось. Можете помочь, так как я уже который день с этим сижу, был бы очень благодарен.


Ответы (0 шт):