I was using the wikipedia module in which you can get the information that is present about that topic on wikipedia. When I run the code it is unable to connect because of proxy. When I connected PC to a proxy free network it's working. It also happened while using the Beautiful soup module for scraping. I have tried to set environment variable like http://username:password@proxy_url:port but when the run the code in IDLE it's not working. Please help.
It worked:
import os
os.environ["HTTPS_PROXY"] = "http://user_id:pass@proxy:port"
If you don't want to store your password in code file:
import os
pxuser = "your.corporate.domain\\your_username"
pxpass = input(f"Password for {pxuser}: ")
env_px = f"http://{pxuser}:{pxpass}@your_proxy:port"
os.environ["HTTPS_PROXY"] = env_px
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With