Merge pull request #189 from aleclol/master

[LoveCalculator] Move .get_text() to after None check
pull/198/merge
bobloy 4 years ago committed by GitHub
commit 269266ce04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,12 +40,12 @@ class LoveCalculator(Cog):
log.debug(f"{resp=}") log.debug(f"{resp=}")
soup_object = BeautifulSoup(resp, "html.parser") 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: if description is None:
description = "Dr. Love is busy right now" description = "Dr. Love is busy right now"
else: else:
description = description.strip() description = description.get_text().strip()
result_image = soup_object.find("img", class_="result__image").get("src") result_image = soup_object.find("img", class_="result__image").get("src")

Loading…
Cancel
Save