明明是文件存在就将其覆盖不存在就创建新文件,为什么还会报错?
代码如下:
A=requests.get(a) soup=BeautifulSoup(A.text,features="lxml") name=str(soup.find('title').text).strip(lu) if e in range(7, 11): response=requests.get("https://music.163.com/song/media/outer/url?id=" + d[0] + ".mp3") with open(name+'.mp3',mode='wb') as f: f.write(response.content) f.close()