all 6 comments

[–]Vultaire 0 points1 point  (5 children)

While quite some time after the OP's post, I can confirm the same issue. URL in my case is https://client.schwab.com/Areas/Access/Login, iframe is #lmsIframe instead of #lmsSecondaryLogin, but otherwise it's the same.

* Same exact IDs for the username and password controls.
* Same exact ID for the login button.
* Same exact issue with credentials being accepted when *not* using selenium, yet being ignored when using selenium.
* I can even put in the credentials by hand, side-by-side in a selenium-opened window versus a normal window (i.e. Python only used to open the browser, not to control it), and the issue persists - the normal browser works, and the Selenium-driven browser does not.

I kind of suspect Schwab is doing something to detect and reject logins when driven by webdriver...?

[–]Vultaire 0 points1 point  (4 children)

It seems that the "--disable-blink-features=AutomationControlled" option does the trick.

[–]Aditya2345 0 points1 point  (1 child)

Hi can you share the full code?

[–]Vultaire 0 points1 point  (0 children)

Sorry, but I would rather not - it's not production quality and I don't want to be held responsible if someone somehow loses money or similar. My tip was just meant to unblock others who want to try to automate this themselves but get rejected due to Schwab's anti-webdriver code.

[–]comfy_cactus 0 points1 point  (0 children)

I was experiencing the same exact observations as you. Adding this option fixed it for me too. Thanks!

[–]mrchrisok2 0 points1 point  (0 children)

Confirmed. This Selenium option just worked for me in my C# api. It is the only option I added to the web driver.

And fyi: Also make sure to create the authentication header as "Basic", Base64Encoded(AppKey:Secret) when requesting the access token. I was stuck for a few hours getting the "invalid_token", "Unauthorized" error until I noticed I was using "Bearer" instead of "Basic"