Ark_orders failing since no data exists in website when combined selected

This commit is contained in:
didier
2021-03-14 20:24:12 +00:00
parent e19fc3388c
commit 207a32ce5e

View File

@@ -41,6 +41,10 @@ def get_ark_orders() -> DataFrame:
parsed_json = json.loads(parsed_script.string)
df_orders = pd.json_normalize(parsed_json["props"]["pageProps"]["arkTrades"])
if df_orders.empty:
return pd.DataFrame()
df_orders.drop(
[
"everything",
@@ -116,6 +120,10 @@ def ark_orders(l_args):
df_orders = get_ark_orders()
if df_orders.empty:
print("The ARK orders aren't anavilable at the moment.\n")
return
pd.set_option("mode.chained_assignment", None)
df_orders = add_order_total(df_orders.head(ns_parser.n_num))