from bs4 import BeautifulSoup import requests from requests import get def getLink(artist, title): base_start = 'https://www.letras.com/' artist = artist.lower() artist = artist.replace(' ', '-') title = title.lower() title = title.replace(' ', '-') link = base_start + artist + '/' + title return(link) def getLyrics(link): w = requests.get(link) soup = BeautifulSoup(w.text, 'html.parser') lyr = soup.find_all('p', class_=False) let = str(lyr) return(let) def parsero(lyrics): lyrics = lyrics.replace('
,', '\n') lyrics = lyrics.replace('', '')
lyrics = lyrics.replace('
', '\n')
lyrics = lyrics.replace('', '\n')
lyrics = lyrics.replace('