马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import urllib.request as ur
response = ur.urlopen("https://www.douban.com/").read()
爬取豆瓣首页 会出错,出错信息如下:
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\1.py", line 3, in <module>
response = ur.urlopen("https://www.douban.com/").read()
File "G:\Python\Python37\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "G:\Python\Python37\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "G:\Python\Python37\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "G:\Python\Python37\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)
File "G:\Python\Python37\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "G:\Python\Python37\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 418:
请问这是什么意思呢?哪里出错了呢 |