Fixing the /ship command to work with the new wiki elements
Some checks failed
Build and push / changes (push) Successful in 7s
Build and push / Lint-Python (push) Successful in 10s
Build and push / Build-and-Push-Docker (push) Failing after 18s
Build and push / sync-argocd-app (push) Has been skipped

This commit is contained in:
Luke Robles 2024-11-10 21:12:03 -08:00
parent e836e57de9
commit 81b71e4bce

View File

@ -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: