Skip to content

Commit

Permalink
fix except
Browse files Browse the repository at this point in the history
  • Loading branch information
tcardonne committed Apr 4, 2019
1 parent 655267c commit f30bb34
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scrapper/getsongs.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,11 @@ def getTrendyRappers(Playlists):
def scrapeSong(url):
page = requests.get(url)
html = BeautifulSoup(page.text, 'html.parser')
lyrics = html.find('div', class_='lyrics').get_text()
return lyrics
try:
lyrics = html.find('div', class_='lyrics').get_text()
return lyrics
except:
return ""


# Write songs in file
Expand Down

0 comments on commit f30bb34

Please sign in to comment.