Здравствуйте, не могу понять как решить проблему. Я купил приватный прокси, который находится в Германии. У этого прокси IPv6 и используется SOCKS5. Сайт на который я делаю запрос поддерживает IPv6.
import requests
responce = requests.get('https://yandex.ru/internet/',
proxies={'https': 'socks5://ChbfSD:GXpaUT@45.63.117.24:18791'})
print(responce.text)
Возникает такая ошибка:
Traceback (most recent call last):
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\socks.py", line 851, in connect
negotiate(self, dest_addr, dest_port)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\socks.py", line 497, in _negotiate_SOCKS5
self, CONNECT, dest_addr)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\socks.py", line 578, in _SOCKS5_request
raise SOCKS5Error("{0:#04x}: {1}".format(status, error))
socks.SOCKS5Error: 0x05: Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\contrib\socks.py", line 88, in _new_conn
**extra_kw
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\socks.py", line 262, in create_connection
raise err
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\socks.py", line 252, in create_connection
sock.connect((remote_host, remote_port))
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\socks.py", line 100, in wrapper
return function(*args, **kwargs)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\socks.py", line 855, in connect
raise GeneralProxyError("Socket error", error)
socks.GeneralProxyError: Socket error: 0x05: Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
conn.connect()
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connection.py", line 284, in connect
conn = self._new_conn()
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\contrib\socks.py", line 110, in _new_conn
"Failed to establish a new connection: %s" % error
urllib3.exceptions.NewConnectionError: <urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x0616C650>: Failed to establish a new connection: 0x05: Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: SOCKSHTTPSConnectionPool(host='yandex.ru', port=443): Max retries exceeded with url: /internet/ (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x0616C650>: Failed to establish a new connection: 0x05: Connection refused',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Dmitry/Desktop/GitHub/Python/Test/main.py", line 4, in <module>
proxies={'https': 'socks5://ChbfSD:GXpaUT@45.63.117.24:18791'})
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Dmitry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 508, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: SOCKSHTTPSConnectionPool(host='yandex.ru', port=443): Max retries exceeded with url: /internet/ (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x0616C650>: Failed to establish a new connection: 0x05: Connection refused',))
Помогите разобраться в чем ошибка и как ее исправить?