|
楼主 |
发表于 2020-6-6 18:05:08
|
显示全部楼层
PyDev console: starting.
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
runfile('F:/python/课后习题/第53讲 爬虫/2020.6.6 从贴吧上爬取图片.py', wdir='F:/python/课后习题/第53讲 爬虫')
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "E:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "E:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "F:/python/课后习题/第53讲 爬虫/2020.6.6 从贴吧上爬取图片.py", line 21, in <module>
get_img(open_url(url))
File "F:/python/课后习题/第53讲 爬虫/2020.6.6 从贴吧上爬取图片.py", line 17, in get_img
urllib.request.urlretrieve(each, filename, None)
File "C:\Program Files\Python38\lib\urllib\request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "C:\Program Files\Python38\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Program Files\Python38\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "C:\Program Files\Python38\lib\urllib\request.py", line 547, in _open
return self._call_chain(self.handle_open, 'unknown',
File "C:\Program Files\Python38\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File "C:\Program Files\Python38\lib\urllib\request.py", line 1390, in unknown_open
raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: "http>
这个是报错的全部代码了 |
|