How to detect Proxy Server settings in Python

25 Views Asked by At

I am very inexperienced in Python and networking in general...

Whenever I open my browser at school, I get "(server name) requires a username and password". Is there a way to retrieve the server name in Python. This is because I am creating a program that utilises the internet and I want this functionality.

I have tried using the code:

import requests

    proxies = {"http":"http://username:password@proxyserver:port"}

    r = requests.get("http://www.example.com/", proxies=proxies)

    print(r.content)

But obviously, I cannot retrieve the proxyserver and port.

0

There are 0 best solutions below