Unable to set proxy in mechanize.browser successfully

121 views Asked by At

I am writing an application where it retrieves data from a film database. To achieve the same, I am using BeautifulSoup and Mechanize for the same.

Thus, while setting the proxy as with in the below ways:


choice 1:

br.set_proxies({"http": "tim:abc1234@localhost:3128"})

O/P:

URLError: urlopen error [Errno 111] Connection refused

choice 2:

br.set_proxies({'http':'localhost',
                    'https':'localhost'})

O/P:

httperror_seek_wrapper: HTTP Error 500: Internal Server Error

choice 3:

br.set_proxies(
     {"http": "tim:[email protected]:3128",
      "ftp": "proxy.example.com"})

O/P:

URLError: urlopen error [Errno -2] Name or service not known

Reference Docs:

Mechanize official docs

Mechanize docs - pdf

Despite following the above reference links I am still unable to set the proxy properly. Any leads would be highly appreciated.

0

There are 0 answers