Fix case where pledge price doesnt exist on the page

This commit is contained in:
Luke Robles 2023-05-16 09:59:59 -07:00
parent f812319fcf
commit 1c37dfc722

View File

@ -78,11 +78,14 @@ async def get_ship(ship_name):
# ingame_price = "No in-game price available"
embed.add_field(name="**Ingame Price**", value=ingame_price, inline=True)
pledge_price = (
soup.find("div", {"class": "data-pledgecost infobox-data infobox-col4"})
.find("div", {"class": "infobox-data__value"})
.text
)
try:
pledge_price = (
soup.find("div", {"class": "data-pledgecost infobox-data infobox-col4"})
.find("div", {"class": "infobox-data__value"})
.text
)
except Exception:
pledge_price = "N/A"
try:
links = soup.find_all("a", {"class": "external text"})