Python proxy settings

I used the wikipedia module where you can get information about a given topic on wikipedia. When I run the code, it cannot connect because of the proxy. When I connected my PC to a proxy free network, it works. This also happened when using the Beautiful soup module to clean up. I tried to set the environment variable as http: // username: password @ proxy _url: port , but when I run the code in IDLE, it doesn't work. Please, help.

+3


source to share


1 answer


It worked:



import os
os.environ["HTTPS_PROXY"] = "http://user_id:pass@proxy:port"

      

+3


source







All Articles