from bs4 import BeautifulSoup import requests from requests import get def getLink(artist, title): base_start = 'https://www.azlyrics.com/lyrics/' artist = artist.lower() artist = artist.replace(' ', '') artist = artist.replace('-', '') title = title.lower() title = title.replace(' ', '') title = title.replace('?', '') title = title.replace("'", '') link = base_start + artist + '/' + title + '.html' return(link) def getLyrics(link): w = requests.get(link) soup = BeautifulSoup(w.text, 'html.parser') lyr = soup.find_all('div', class_=False) let = str(lyr) return(let) def parsero(lyrics): let = lyrics let = let.replace('
', ' ') let = let.replace('', '') let = let.replace('', '') let = let.replace('
', '') let = let.replace('
,', '') let = let.replace('', '') let = let.replace('
', '') let = let.replace('
', '') let = let.replace('
', '') let = let.replace('', '') return(let[1:-1])