diff --git a/fidelityAPI.py b/fidelityAPI.py index 66b94632..2c669916 100755 --- a/fidelityAPI.py +++ b/fidelityAPI.py @@ -320,7 +320,7 @@ def getAccountInfo(self): # Get the last price last_price = str(row["Last Price"]).replace("$", "") # Get quantity - quantity = row["Quantity"] + quantity = str(row["Quantity"]).replace("-", "") # Get ticker ticker = str(row["Symbol"]) @@ -335,9 +335,9 @@ def getAccountInfo(self): # If the last price isn't available, just use the current value if len(last_price) == 0: last_price = val - # If the quantity is missing, just use 1 + # If the quantity is missing skip it if len(quantity) == 0: - quantity = 1 + continue # If the account number isn't populated yet, add it if row["Account Number"] not in self.account_dict: diff --git a/wellsfargoAPI.py b/wellsfargoAPI.py index 7d6c779f..65fcf968 100644 --- a/wellsfargoAPI.py +++ b/wellsfargoAPI.py @@ -132,7 +132,7 @@ def wellsfargo_init(botObj, WELLSFARGO_EXTERNAL=None, DOCKER=False, loop=None): balance_element = account_block.find_element( By.CSS_SELECTOR, '[data-testid$="-balance"]' ) - balance = float(balance_element.text.replace("$", "")) + balance = float(balance_element.text.replace("$", "").replace(",", "")) WELLSFARGO_obj.set_account_totals(name, masked_number_text, balance) except Exception as e: wellsfargo_error(driver, e)