I want to access my company's private website through Python. I have a file mycode.py with the following script inside
import urllib.request
url = 'https://my-company-website.com'
with urllib.request.urlopen(url) as response:
html = response.read()
print(html)
I have included my corporate proxy in global system environment variables HTTP_PROXY and HTTPS_PROXY.
When I try and run this code, either through cmd as "python mycode.py" or by running a Jupyter notebook cell with this code inside I get the same error which is "Tunnel connection failed: 503 Service Unavailable". But when I run "python mycode.py" through cygwin it works just as expected.
Can this be explained by a simple reason or what could the reasons for this behaviour be?