Fix case where pledge price doesnt exist on the page
This commit is contained in:
parent
f812319fcf
commit
1c37dfc722
@ -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"})
|
||||
|
Loading…
x
Reference in New Issue
Block a user