Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PyLyrics/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PyLyrics:
@staticmethod
def getAlbums(singer):
singer = singer.replace(' ', '_')
s = BeautifulSoup(requests.get('http://lyrics.wikia.com/{0}'.format(singer)).text)
s = BeautifulSoup(requests.get('http://lyrics.wikia.com/{0}'.format(singer)).text, features='html.parser')
spans = s.findAll('span',{'class':'mw-headline'})

als = []
Expand All @@ -60,7 +60,7 @@ def getAlbums(singer):
@staticmethod
def getTracks(album):
url = "http://lyrics.wikia.com/api.php?action=lyrics&artist={0}&fmt=xml".format(album.artist())
soup = BeautifulSoup(requests.get(url).text)
soup = BeautifulSoup(requests.get(url).text, features='html.parser')

for al in soup.find_all('album'):
if al.text.lower().strip() == album.name.strip().lower():
Expand All @@ -75,7 +75,7 @@ def getLyrics(singer, song):
singer = singer.replace(' ', '_')
song = song.replace(' ', '_')
r = requests.get('http://lyrics.wikia.com/{0}:{1}'.format(singer,song))
s = BeautifulSoup(r.text)
s = BeautifulSoup(r.text, features='html.parser')
#Get main lyrics holder
lyrics = s.find("div",{'class':'lyricbox'})
if lyrics is None:
Expand Down