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