better url handling

This commit is contained in:
Gordon Shumway 2019-03-22 18:02:21 -04:00 committed by GitHub
parent 8abb2ba247
commit 3a0faaee46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -36,9 +36,9 @@ class Lyrics(callbacks.Plugin):
header = {'User-Agent':str(ua.random)}
data = requests.get(searchurl, headers=header)
soup = BeautifulSoup(data.text)
url = soup.find('cite').getText()
elements = soup.select('.r a')
url = elements[0]['href']
title = soup.find("h3").getText()
url = "http://{0}".format(url)
except Exception:
return
else: