Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeouts on login screen #1

Open
davidacrook opened this issue Jun 19, 2024 · 2 comments
Open

Timeouts on login screen #1

davidacrook opened this issue Jun 19, 2024 · 2 comments

Comments

@davidacrook
Copy link

Hi,

Thank you so much for writing this!

I'm trying to get it to work on an Ubuntu VM, latest version and am getting timeouts on the #schwablmslogin locator. I couldn't get this far until I changed the browser type to chromium instead of firefox, but now I'm stuck. I've tried it multiple times on a Linux VM as well as in WSL and keep hitting the 30 second timeout. I looked at the schwab website and the schwablmslogin iframe is still there.

Thanks,

Dave

Log:
2024-06-19T19:38:30.475Z info: retrieving account information
2024-06-19T19:38:30.477Z debug: performing HTTP GET request with authentication: https://client.schwab.com/api/PositionV2/PositionsDataV2
2024-06-19T19:38:30.477Z debug: authenticating request with options: {"loginIfRequired":true,"rememberDevice":true}
2024-06-19T19:38:30.477Z info: login required, attempting login
2024-06-19T19:38:30.478Z debug: initializing chromium browser with headless: true
2024-06-19T19:38:31.065Z debug: initializing new context with user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
2024-06-19T19:38:31.115Z debug: initializing new page with viewport: {"width":1920,"height":1080}
2024-06-19T19:38:34.804Z debug: navigating to : https://www.schwab.com/
2024-06-19T19:38:35.733Z debug: waiting for login frame : #schwablmslogin
2024-06-19T19:39:05.738Z info: failed to retrieve account information: TimeoutError: page.waitForSelector: Timeout 30000ms exceeded.
Call log:

  • waiting for locator('#schwablmslogin') to be visible

2024-06-19T19:39:05.738Z error: Retrieving account information was not successful.
2024-06-19T19:39:05.738Z error: The attempt to retrieve account information produced the following error:
2024-06-19T19:39:05.738Z error: page.waitForSelector: Timeout 30000ms exceeded.
Call log:

  • waiting for locator('#schwablmslogin') to be visible

    at /home/dcrook/node_modules/schwab-api/lib/session.js:268:29
    at async withCleanErrors (/home/dcrook/node_modules/schwab-api/lib/logging.js:20:16)
    at async Schwab.authenticate (/home/dcrook/node_modules/schwab-api/lib/session.js:61:34)

@nathan-fiscaletti
Copy link
Owner

Hey, curious question. Is this a headless VM? If it is not a headless VM, can you try adding the headless: false option to the Schwab constructor to open the browser while it performs the authentication? It might make it a little more clear what's happening.

const schwab = new Schwab({
    username: 'your-username',
    password: 'your-password',
    headless: false,
});

@davidacrook
Copy link
Author

Thank you for the quick response and the tip about headless: false! I set headless: false and login fields are visible but program doesn't recognize them, even though I can see the id it's waiting on in the source. Logging in manually through the launched browser works in WSL but not Ubuntu, but doesn't help the program as it's still waiting on the login fields.

WSL:
Successful login in browser outside of program.
Using headless=false in program opens browser, login fields visible and cursor is on userid. Program never recognizes login fields and times out.
Logging into the browser started by the program with headless=false works, but program still times out waiting for login fields.

Ubuntu 24.04 VM:
Successful login in browser outside of program.
Using headless=false in program opens browser, login fields visible and cursor is on userid. Program never recognizes login fields and times out.
Logging into the browser started by the program with headless=false doesn't work and displays "We're unable to authorize your access."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants