title: python urllib2.URLError handling
body: <p>I'm extracting live feed from a webpage in json. The page updates every minute so I would extract the data every minute. But the server of that webpage is sometimes not very stable and my code stops running. I want to write it in a way that my code will constantly requesting for data until it gets it. Someone wrote something like this before: </p>
  
  <pre><code>try: 
      f=urllib2.open(blablabla...)
  
  except urllib2.HTTPError, detail:
      if detail.error == 500:
        time.sleep(1)
        continue
      else:
        raise
  </code></pre>
  
  <p>But my code still stops running with this error: 
  urllib2.URLError: urlopen error [Errno 8] nodename nor servname provided, or not known</p>