0

I'm trying to run a simple code as below from my workplace,

proxy = urllib2.ProxyHandler({'http': 'proxy.examply.com:8080'})
opener = build_opener(proxy)
resp = opener.open('http://www.solver.io')

But it throws below error- Traceback (most recent call last):

  File "<pyshell#11>", line 1, in <module>
    response = urllib2.urlopen('http://www.solver.io')
  File "C:\Python27\lib\urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python27\lib\urllib2.py", line 437, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 469, in error
    result = self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 656, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "C:\Python27\lib\urllib2.py", line 431, in open
    response = self._open(req, data)
  File "C:\Python27\lib\urllib2.py", line 449, in _open
    '_open', req)
  File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 1240, in https_open
    context=self._context)
  File "C:\Python27\lib\urllib2.py", line 1197, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 10060] A 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>

I've tried pip install , aws, boto which work just fine behind the proxy.

I've even tried this solutions on stackoverflow but didnt work

how to resolve this please?

Community
  • 1
  • 1
swapnil jariwala
  • 1,064
  • 2
  • 12
  • 19

0 Answers0