From 7edae3b5f4cc9b6d37c7764605373a264bfb535a Mon Sep 17 00:00:00 2001 From: maxxrk Date: Mon, 14 Oct 2024 18:11:35 -0500 Subject: [PATCH] fix fidelity place order --- fidelityAPI.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fidelityAPI.py b/fidelityAPI.py index e3f1fc79..4148e2e0 100755 --- a/fidelityAPI.py +++ b/fidelityAPI.py @@ -551,7 +551,9 @@ def transaction( # If error occurred try: self.page.get_by_role( - "button", name="Place order clicking this" + "button", + name="Place order", + exact=False, ).wait_for(timeout=4000, state="visible") except PlaywrightTimeoutError: # Error must be present (or really slow page for some reason) @@ -611,11 +613,13 @@ def transaction( # If its a real run if not dry: self.page.get_by_role( - "button", name="Place order clicking this" + "button", + name="Place order", + exact=False, ).click() try: # See that the order goes through - self.page.get_by_text("Order received").wait_for( + self.page.get_by_text("Order received", exact=True).wait_for( timeout=5000, state="visible" ) # If no error, return with success