title: How to fix "unknown url-type error" in urllib2
body: <p>I am trying to build a search engine starting with Udacity's python class.
  At a point i ran my program and got this error with a whole bunch of other stuff. can somebody help me get started in making sense of all this errors.</p>
  
  <p>Traceback (most recent call last):</p>
  
  <pre><code>  File "E:\Python codes\MySearchEngine.py", line 106, in &lt;module&gt;
      crawl_web(startPage)
    File "E:\Python codes\MySearchEngine.py", line 66, in crawl_web
      linksToFollow = followLinks(toCrawl)
    File "E:\Python codes\MySearchEngine.py", line 53, in followLinks
      linkPageContent = get_page(link)
    File "E:\Python codes\MySearchEngine.py", line 4, in get_page
      page = urllib2.urlopen(page).read()
    File "C:\Python27\lib\urllib2.py", line 126, in urlopen
      return _opener.open(url, data, timeout)
    File "C:\Python27\lib\urllib2.py", line 392, in open
      protocol = req.get_type()
    File "C:\Python27\lib\urllib2.py", line 254, in get_type
      raise ValueError, "unknown url type: %s" % self.__original
  ValueError: unknown url type: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"&gt;
  </code></pre>