我正在尝试从 Udacity 的 python 类开始构建一个搜索引擎。有一次,我运行了我的程序,并在一堆其他东西中遇到了这个错误。有人可以帮助我开始理解所有这些错误吗?
回溯(最近一次通话最后):
File "E:\Python codes\MySearchEngine.py", line 106, in <module>
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"><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">