diff --git a/app/cogs/game_apis.py b/app/cogs/game_apis.py index f967ce32..d1dcaa6c 100755 --- a/app/cogs/game_apis.py +++ b/app/cogs/game_apis.py @@ -27,21 +27,17 @@ class Games(commands.Cog): async def get_ffxiv_worlds(ctx: discord.AutocompleteContext): url = "https://na.finalfantasyxiv.com/lodestone/worldstatus/" - # Send an HTTP GET request to the URL response = requests.get(url) soup = BeautifulSoup(response.text, "html.parser") # Find all elements with class "world-list__world_name" world_name_elements = soup.find_all(class_="world-list__world_name") - # Initialize an empty list to store the contents of the elements - worlds = [] - # Loop through each element and extract its contents - for element in world_name_elements: - # Extract the text content of the element - element_content = element.get_text(strip=True) - worlds.append(element_content) + worlds = [ + element.get_text(strip=True) + for element in soup.find_all(class_="world-list__world_name") + ] return worlds