本想做个爬虫练练手,我原本的想法是每张图片的名称都保存为“当前时间+编号.jpg”(格式为year/month/date hour/minute/second+num.jpg),但是不知道为什么会出现这种错误,求大佬帮忙看看
import requests
import datetime
for i in range(1000):
response = requests.get('https://api.ixiaowai.cn/api/api.php')
curr_time = datetime.datetime.now()
time_str = datetime.datetime.strftime(curr_time,'%Y/%m/%d %H/%M/%S')
with open(time_str+".jpg","wb+") as f:
f.write(response.content)