0

What does this error mean? How can I get rid of this problem?

Traceback (most recent call last):
  File "bestcodeever.py", line 16, in <module>
    html=urllib2.urlopen('http://' + fulllink).read()
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Unavailable
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • What part of *"Service Unavailable"* is confusing you? Are we supposed to *guess* what website you are trying to connect to? – jonrsharpe Dec 11 '14 at 17:51
  • 3
    A "Service Unavailable" error usually occurs when the service is unavailable. I suggest waiting until the service is available before trying again. – Kevin Dec 11 '14 at 17:51

1 Answers1

1

The HTTP 503 status code means that the web server you've tried to contact is unavailable (perhaps for maintenance reasons). It's still able to respond minimally with this code, so it isn't offline and it is listening to requests, it's just not returning the service you want for now: just try again later.

It is also possible that your IP address has been blacklisted by the server if you've been a bit too demanding of it with your Python scripts lately...

xnx
  • 24,509
  • 11
  • 70
  • 109
  • Hooray! A simple descriptive answer rather than snarky off-putting comments. – Thorin Schmidt Dec 11 '14 at 18:02
  • whenever I tried, I got this messege,, Is there any way to crawl those sites? – arun jadav Dec 12 '14 at 01:23
  • That's another question, but if you can visit the page (is it an HTML document?) from a browser, you might try to change the urllib2 user-agent. See http://stackoverflow.com/questions/802134/changing-user-agent-on-urllib2-urlopen – xnx Dec 12 '14 at 01:34