From 73888f22165b707d8c9679e1adeb2bc2637f67cb Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Sat, 25 Nov 2023 10:26:54 -0800 Subject: [PATCH] Add loaner to /ship command if it exists on the page --- app/star_citizen.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/star_citizen.py b/app/star_citizen.py index af09d6d9..f7ecdd98 100755 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -151,6 +151,19 @@ async def get_ship(ship_name): value=pledge_price, inline=True, ) + try: + loaner = ( + soup.find("div", {"class": "infobox__label"}, string="Loaner") + .findNext("div", {"class": "infobox__data"}) + .text + ) + embed.add_field( + name="**Loaner**", + value=loaner, + inline=True, + ) + except Exception: + pass try: buy_location = (