Mechanize Scraping Headers Not Working
<p>I'm trying to use Mechanize to browse a website using Python, but I keep getting this error:</p>

<pre><code>"connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
</code></pre>

<p>I added a header but it still doesn't work. My header is shown below:</p>

<pre><code>httpproxy = "myproxy@myserver.com"
proxydict = {
            "https": httpproxy,
             "http": httpproxy
             }
url = 'https://www.privateequityinternational.com/BREXIT/'
br = mechanize.Browser()
br.set_proxies(proxydict)
br.set_handle_robots(False)
#br.addheaders = [('Referer', 'http://google.com')]
br.set_handle_equiv(False)
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
br.open(url)
</code></pre>

<p>Any help would be greatly appreciated.</p>