for url in get_page_link(2199,2201):
dl_img(url)
time.sleep(2)
虽然想多页下载,但每次还是只能下载一页的图片,比如上面的代码中就只能下载2199那一页的图片,之后就会报错:
Traceback (most recent call last):
File "F:/python/外部包或学习视频/4周实现爬虫/课程资料/Plan-for-combating-master/week1/1_3/等会就删.py", line 28, in <module>
dl_img(url)
File "F:/p困扰很久了,求各位相助!
ython/外部包或学习视频/4周实现爬虫/课程资料/Plan-for-combating-master/week1/1_3/等会就删.py", line 24, in dl_img
urllib.request.urlretrieve(url,folder_path + url[-10:])
File "F:\python3\lib\urllib\request.py", line 198, in urlretrieve
tfp = open(filename, 'wb')
FileNotFoundError: [Errno 2] No such file or directory: 'E://jiandan/g/1112.png'