0
我是新來的python,並試圖提取頁面的內容。當我做urlopen('http://www.google.com')
時,出現以下錯誤:urllib2.urlopen('你')給出錯誤
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 391, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 409, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1185, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1160, in do_open
raise URLError(err)
對此的任何解決方案?
請正確縮進您的錯誤追溯。另外,請包含您的實際代碼。 – 2011-06-03 10:15:40
錯誤信息是什麼? – 2011-06-03 10:28:39
錯誤追溯開始時間短,單間隔,易於閱讀的事情。爲什麼它在這裏雙倍間距? – 2011-06-03 11:04:25