• python中我用wb方式打开文件,报错说没有此文件?
  • python

明明是文件存在就将其覆盖不存在就创建新文件,为什么还会报错?

代码如下:

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()


627ACE8D-EA35-43ec-AA09-551A65B15D5C.png

  • 大椿    2021-03-29 15:50:53
  • 阅读 3032    收藏 0    回答 2
  • 邀请
  • 收藏
  • 分享
发送
登录 后发表评论
  • 51testing软件测试圈微信