Not supported proxy scheme error
See original GitHub issueI am conecting to the internet through a proxy server. I used the below code to send a HTTP GET request using requests library in python.
import requests
from requests.auth import HTTPProxyAuth
url = "http://httpbin.org/get"
proxies = {"http":"my-proxy-server: port"}
auth = HTTPProxyAuth("username", "password")
r = requests.get(url, proxies=proxies, auth=auth)
print r
but It gives me the following error
Traceback (most recent call last):
File "D:\python_http_req.py", line 7, in <module>
r = requests.get(url, proxies=proxies, auth=auth)
File "C:\Python27\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 410, in send
conn = self.get_connection(request.url, proxies)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 308, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 198, in proxy_manager_for
**proxy_kwargs)
File "C:\Python27\lib\site-packages\urllib3\poolmanager.py", line 449, in proxy_from_url
return ProxyManager(proxy_url=url, **kw)
File "C:\Python27\lib\site-packages\urllib3\poolmanager.py", line 400, in __init__
raise ProxySchemeUnknown(proxy.scheme)
ProxySchemeUnknown: Not supported proxy scheme my-proxy-server
can anybody help me to resolve this error?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
pip, proxy authentication and "Not supported proxy scheme"
This is complaining about the scheme for the URL (which urlparse is understanding to be myusr ), to work around that you should...
Read more >ProxySchemeUnknown('Not supported proxy scheme proxy-au',)
Cause. These errors can occur when the firewall is blocking access to the Anaconda library where the Python environment is stored. Solution ...
Read more >Assertion error: Not supported proxy ... - JetBrains YouTrack
Currently "pip –proxy=user:password@proxy_ip:proxy_port install package_name" this command will produce the following error "AssertionError: Not supported ...
Read more >Trying to use proxies to scrape amazon with requests. Getting ...
Trying to use proxies to scrape amazon with requests. Getting this error: urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None.
Read more >pip, proxy authentication and "Not supported proxy scheme"
Answer a question Trying to install pip on a new python installation. I am stuck with proxy errors. Looks like a bug in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
from requests.auth import HTTPProxyAuth proxyDict = { ‘http’ : ‘http://138.197.222.35:80’, ‘https’ : ‘http://1138.197.222.35:8080’ } #auth = HTTPProxyAuth(‘username’, ‘mypassword’) r = requests.get(‘http://httpbin.org/ip’, proxies=proxyDict) print ®
@oshadaamila This issue is resolved with solution by @samiashton1989 Consider it closing.