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"
|
# ingame_price = "No in-game price available"
|
||||||
embed.add_field(name="**Ingame Price**", value=ingame_price, inline=True)
|
embed.add_field(name="**Ingame Price**", value=ingame_price, inline=True)
|
||||||
|
|
||||||
|
try:
|
||||||
pledge_price = (
|
pledge_price = (
|
||||||
soup.find("div", {"class": "data-pledgecost infobox-data infobox-col4"})
|
soup.find("div", {"class": "data-pledgecost infobox-data infobox-col4"})
|
||||||
.find("div", {"class": "infobox-data__value"})
|
.find("div", {"class": "infobox-data__value"})
|
||||||
.text
|
.text
|
||||||
)
|
)
|
||||||
|
except Exception:
|
||||||
|
pledge_price = "N/A"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
links = soup.find_all("a", {"class": "external text"})
|
links = soup.find_all("a", {"class": "external text"})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user