def lyrics_from_path(path):
"""Gets the lyrics from a song path"""
with requests.get(path) as page:
html = BeautifulSoup(page.text, "html.parser")
[h.extract() for h in html('script')]
lyrics = html.find("div", class_="lyrics").get_text()
return lyrics
评论列表
文章目录