diff --git a/schwab_api/authentication.py b/schwab_api/authentication.py index ac7a8ed..71285a2 100644 --- a/schwab_api/authentication.py +++ b/schwab_api/authentication.py @@ -34,7 +34,7 @@ def get_session(self): return self.session def login(self, username, password, totp_secret=None): - """ This function will log the user into schwab using asynchoneous Playwright and saving + """ This function will log the user into schwab using asynchronous Playwright and saving the authentication cookies in the session header. :type username: str :param username: The username for the schwab account. @@ -93,7 +93,7 @@ async def _async_login(self, username, password, totp_secret=None): try: await self.page.frame(name=login_frame).press("[placeholder=\"Password\"]", "Enter") - await self.page.wait_for_url(urls.trade_ticket()) + await self.page.wait_for_url(".*app/trade.*") # Making it more robust than specigying an exact url which may change. except TimeoutError: raise Exception("Login was not successful; please check username and password")