From f4c0dfb69d7e45d24f792e56ba47a8774a27f32a Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Wed, 7 Apr 2021 11:48:42 -0700 Subject: [PATCH] [Dictionary] Fix for antonyms and synonym lookup --- dictionary/dictionary.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dictionary/dictionary.py b/dictionary/dictionary.py index d337eaf..a94b357 100644 --- a/dictionary/dictionary.py +++ b/dictionary/dictionary.py @@ -50,8 +50,8 @@ class Dictionary(commands.Cog): data = await self._get_soup_object(f"http://www.thesaurus.com/browse/{word}") if not data: return await ctx.send("Error fetching data.") - section = data.find_all("a", {"class": "css-1dcngqk eh475bn1"}) - antonyms = [item.text.rstrip() for item in section] + section = data.find_all("ul", {"class": "css-1dnnh8h e1ccqdb60"}) + antonyms = section[0].text.split() return antonyms @commands.command() @@ -111,8 +111,8 @@ class Dictionary(commands.Cog): data = await self._get_soup_object(f"http://www.thesaurus.com/browse/{word}") if not data: return await ctx.send("Error fetching data.") - section = data.find_all("a", {"class": "css-1m14xsh eh475bn1"}) - synonyms = [item.text.rstrip() for item in section] + section = data.find_all("ul", {"class": "css-1l7o0dd e1ccqdb60"}) + synonyms = section[0].text.split() return synonyms @commands.command()