From 5260e4fbf5dba265d0d1775805ae5cafe779bfcc Mon Sep 17 00:00:00 2001 From: gouravkr Date: Mon, 10 Jan 2022 07:10:38 +0530 Subject: [PATCH] synonym not slugified was causing error --- word_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/word_bot.py b/word_bot.py index f789564..6dfab6f 100644 --- a/word_bot.py +++ b/word_bot.py @@ -137,7 +137,7 @@ def get_synonyms(word: str) -> str: response = requests.get(syn_url.format(word.lower())) soup = BeautifulSoup(response.content, 'html.parser') synonyms = soup.find_all(['strong', 'span'], {'class': 'syn'}) - synonym_list = [f'\n*{slugify(i.string)}*' if i.name == 'strong' else i.string for i in synonyms] + synonym_list = [f'\n*{slugify(i.string)}*' if i.name == 'strong' else slugify(i.string) for i in synonyms] return (''.join(synonym_list))