From 2d7368b6064053a85b7eb9e0daaf91e32ab986a2 Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Mon, 28 Aug 2023 23:13:10 +0700 Subject: [PATCH] Tes return None --- misskaty/plugins/web_scraper.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/misskaty/plugins/web_scraper.py b/misskaty/plugins/web_scraper.py index 325d6744..1901dc28 100644 --- a/misskaty/plugins/web_scraper.py +++ b/misskaty/plugins/web_scraper.py @@ -454,14 +454,15 @@ async def getDataGomov(msg, kueri, CurrentPage, user, strings): strings("no_result_w_query").format(kueri=kueri), del_in=5 ) return None, 0, None - data = [] - for i in entry: - genre = i.find(class_="gmr-movie-on").text - genre = f"{genre}" if genre != "" else "N/A" - judul = i.find(class_="entry-title").find("a").text - link = i.find(class_="entry-title").find("a").get("href") - data.append({"judul": judul, "link": link, "genre": genre}) - SCRAP_DICT.add(msg.id, [split_arr(data, 6), kueri], timeout=1800) + else: + data = [] + for i in entry: + genre = i.find(class_="gmr-movie-on").text + genre = f"{genre}" if genre != "" else "N/A" + judul = i.find(class_="entry-title").find("a").text + link = i.find(class_="entry-title").find("a").get("href") + data.append({"judul": judul, "link": link, "genre": genre}) + SCRAP_DICT.add(msg.id, [split_arr(data, 6), kueri], timeout=1800) try: index = int(CurrentPage - 1) PageLen = len(SCRAP_DICT[msg.id][0])