title: Python check if website exists
body: <p>I wanted to check if a certain website exists, this is what I'm doing:</p>
  
  <pre><code>user_agent = 'Mozilla/20.0.1 (compatible; MSIE 5.5; Windows NT)'
  headers = { 'User-Agent':user_agent }
  link = "http://www.abc.com"
  req = urllib2.Request(link, headers = headers)
  page = urllib2.urlopen(req).read() - ERROR 402 generated here!
  </code></pre>
  
  <p>If the page doesn't exist (error 402, or whatever other errors), what can I do in the <code>page = ...</code> line to make sure that the page I'm reading does exit?</p>