0

I'm writing this application where the user can perform a web search to obtain some information from a particular website. Everything works well except when I'm connected to the Internet via Proxy (it's a corporate proxy). The thing is, it works sometimes. By sometimes I mean that if it stops working, all I have to do is to use any web browser (Chrome, IE, etc.) to surf the internet and then python's requests start working as before. The error I get is: OSError('Tunnel connection failed: 407 Proxy Authentication Required',) My guess is that some sort of credentials are validated and the proxy tunnel is up again. I tried with the proxies handlers but it remains the same. My doubts are:

  1. How do I know if the proxy need authentication, and if so, how to do it without hardcoding the username and password since this application will be used by others?
  2. Is there a way to use the Windows default proxy configuration so it will work like the browsers do?
  3. What do you think that happens when I surf the internet and then the python requests start working again?

I tried with requests and urllib.request

Any help is appreciated.

Thank you!

asked Jul 18, 2017 at 2:39
1

1 Answer 1

0

Check if there is any proxy setting in chrome

answered Jul 18, 2017 at 2:46
Sign up to request clarification or add additional context in comments.

2 Comments

Yes, there is a proxy setting
Thanks, but as I said, I've tried with proxies configuration and nothing changed. I also don't want to hardcode the password and if possible avoid asking it. I'm also not sure if that would help since I did a test hardcoding my username and password and nothing changed

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.