From b331238c1c5544084365eb62ffb8a03cbb7a1306 Mon Sep 17 00:00:00 2001 From: aleclol <50505980+aleclol@users.noreply.github.com> Date: Sat, 3 Jul 2021 22:11:42 -0400 Subject: [PATCH] Move .get_text() to after None check --- lovecalculator/lovecalculator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lovecalculator/lovecalculator.py b/lovecalculator/lovecalculator.py index d6ae4fe..7473f74 100644 --- a/lovecalculator/lovecalculator.py +++ b/lovecalculator/lovecalculator.py @@ -40,12 +40,12 @@ class LoveCalculator(Cog): log.debug(f"{resp=}") soup_object = BeautifulSoup(resp, "html.parser") - description = soup_object.find("div", class_="result__score").get_text() + description = soup_object.find("div", class_="result__score") if description is None: description = "Dr. Love is busy right now" else: - description = description.strip() + description = description.get_text().strip() result_image = soup_object.find("img", class_="result__image").get("src")