I want to connect to one URL, which is blocked, using python requests.
I used many different proxy servers none worked for me. https://free-proxy-list.net/
import requests
x = '46.21.153.16:3128'
http_proxy = "http://"+x
https_proxy = "https://"+x
proxyDict = {
"http": http_proxy,
"https": https_proxy
}
a = requests.get('https://example.com', proxies=proxyDict)
print(a.status_code)
Traceback (most recent call last): File "t.py", line 14, in a = requests.get('https://my-url', proxies=proxyDict) File "/home/user/Documents/backend1/venv-livedx/lib/python3.5/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/home/user/Documents/livedx/backend1/venv-livedx/lib/python3.5/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/home/user/Documents/backend1/venv-livedx/lib/python3.5/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "/home/user/Documents/backend1/venv-livedx/lib/python3.5/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/home/user/Documents/backend1/venv-livedx/lib/python3.5/site-packages/requests/adapters.py", line 510, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='my-url', port=443): Max retries exceeded with url: /management (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))