From 81b71e4bce5859af515c17215e247fefb7caf6fe Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Sun, 10 Nov 2024 21:12:03 -0800 Subject: [PATCH] Fixing the /ship command to work with the new wiki elements --- app/star_citizen.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/app/star_citizen.py b/app/star_citizen.py index cf7b6154..78b10c23 100755 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -261,8 +261,10 @@ async def get_ship(ship_name): ) try: pledge_price = ( - soup.find("div", {"class": "infobox__label"}, string="Standalone") - .findNext("span", {"class": "smwtext"}) + soup.find( + "span", {"class": "ext-floatingui-reference"}, string="Standalone" + ) + .findNext("div", {"class": "infobox__data"}) .text ) except Exception: @@ -413,8 +415,10 @@ async def get_ship(ship_name): embed.add_field(name="-------", value="", inline=False) try: length = ( - soup.find("div", {"class": "infobox__label"}, string="Length") - .findNext("span", {"class": "smwtext"}) + soup.find( + "div", {"class": "template-dimensions-label"}, string="Length" + ) + .findNext("div", {"class": "template-dimensions-data"}) .text ) except Exception: @@ -424,8 +428,8 @@ async def get_ship(ship_name): try: width = ( - soup.find("div", {"class": "infobox__label"}, string="Width") - .findNext("span", {"class": "smwtext"}) + soup.find("div", {"class": "template-dimensions-label"}, string="Width") + .findNext("div", {"class": "template-dimensions-data"}) .text ) except Exception: @@ -435,8 +439,10 @@ async def get_ship(ship_name): try: height = ( - soup.find("div", {"class": "infobox__label"}, string="Height") - .findNext("span", {"class": "smwtext"}) + soup.find( + "div", {"class": "template-dimensions-label"}, string="Height" + ) + .findNext("div", {"class": "template-dimensions-data"}) .text ) except Exception: