I'm attempting to write a script that logs in to my online banking account (USAA) and gets the transaction information so that I can do some analysis on it. I managed to get Playwright to correctly go to the webpage, enter my username, and click the "Next" button, but every time it does that, I get the below pop-up message:
We are unable to complete your request. Our system is currently unavailable. Please try again later.
When I manually enter my username and click the "Next" button, however, it works just fine. The code I'm using is below:
from playwright.sync_api import sync_playwright
import dotenv
import os
dotenv.load_dotenv()
USER_NAME = os.getenv('USER_NAME') or ''
PASSWORD = os.getenv('PASSWORD') or ''
with sync_playwright() as p:
browser = p.chromium.launch(headless=False, slow_mo=1000)
context = browser.new_context(user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36')
page = context.new_page()
page.goto('https://www.usaa.com/my/logon?logoffjump=true&wa_ref=pub_global_log_on')
page.locator('input:below(:text(\'Online ID\'))').fill(USER_NAME)
page.locator('button[type=submit]').click()
page.locator('input:below(:text(\'Password\'))').fill(PASSWORD)
page.locator('button[type=submit]').click()
I suspect that the issue isn't within the code itself, but perhaps with some security feature I'm not aware of, much less how to get around. Has anyone else successfully written a script that accomplishes this? Did you have to get around this issue? If so, how did you do it?