Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Throwing [HTTPError: HTTP Error 503: Service Unavailable] Error after the selenium tests are done using Python

 self.driver.quit()
  File "C:\Python27\lib\site-packages\selenium-2.40.0-py2.7.egg\selenium\webdriver\chrome\webdriver.py", line 82, in quit
    self.service.stop()
  File "C:\Python27\lib\site-packages\selenium-2.40.0-py2.7.egg\selenium\webdriver\chrome\service.py", line 97, in stop
    url_request.urlopen("http://127.0.0.1:%d/shutdown" % self.port)
  File "C:\Python27\lib\urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\Python27\lib\urllib2.py", line 410, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

HTTPError: HTTP Error 503: Service Unavailable
like image 315
Prashanth Sams Avatar asked Mar 06 '14 12:03

Prashanth Sams


2 Answers

Does this by any chance happen only with Chrome? I ran into a similar issue that produces the exact same stack trace (albeit with a 407 instead of a 503), so I'm curious to see if the same solution would help here.

Navigate to Control Panel > Internet Options > Connections tab > LAN settings > Advanced. Then, insert 127.0.0.1 into the Exceptions box. In my case, this was sufficient to prevent the crash upon calling .quit().

like image 197
Tetrinity Avatar answered Sep 22 '22 09:09

Tetrinity


This is an issue on Chrome browser. The following steps will give you the fix.

1| Uncheck the Check Box, By Proxy server for local address

enter image description here

2| Click on Advanced Tab

enter image description here

3| Enter 127.0.0.1 under Exceptions panel

4| Click ok

like image 30
Prashanth Sams Avatar answered Sep 22 '22 09:09

Prashanth Sams