From 214a517c9688152d50d602ddc061c31bc7e2833e Mon Sep 17 00:00:00 2001 From: Joinemm Date: Sat, 29 Jul 2023 11:31:05 +0300 Subject: [PATCH] Fix artist chart --- cogs/lastfm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/lastfm.py b/cogs/lastfm.py index edd5151..be6a9c2 100644 --- a/cogs/lastfm.py +++ b/cogs/lastfm.py @@ -2603,7 +2603,8 @@ async def scrape_artists_for_chart(self, username, period, amount): raise exceptions.LastFMError(0, error) soup = BeautifulSoup(data, "lxml") - imagedivs = soup.findAll("td", {"class": "chartlist-image"}) + tbody = soup.findAll("tbody", {"data-playlisting-add-entries": ""})[-2] + imagedivs = tbody.findAll("td", {"class": "chartlist-image"}) images += [ div.find("img")["src"].replace("/avatar70s/", "/300x300/") for div in imagedivs