# img_content = requests.get(url=img_url, headers=headers).content# with open(r'C:jupyterday02%s.jpg' % filename, 'wb') as f:# f.write(img_content)request.urlretrieve(url=img_url, filename='img' + str(i) + '.jpg')
爬虫篇-request模块-urlretrieve方法
时间:2023-05-17
使用request.urlretrieve代替with open保存网络文件
相关推荐