itsjafer / schwab-api

A python library for placing trades on Charles Schwab
MIT License
206 stars 64 forks source link

Login form name #1

Closed cckev closed 3 years ago

cckev commented 3 years ago

Looks like Schwab pushed some changes on the front-end of their Login page: https://www.schwab.com/public/schwab/nn/login/login.html?lang=en

The iframe seems to have been renamed to 'lmsSecondaryLogin'. The current code in schwab.py throws an error: https://github.com/itsjafer/schwab-api/blob/d9f34db2eb1646951699d9ff624673e5870fa824/schwab_api/schwab.py#L96

Traceback (most recent call last):
  ...[snipped]...
  File "E:\...\schwab_api\schwab.py", line 101, in login
    self.page.frame(name="loginIframe").fill('input[name="LoginId"]', "")
AttributeError: 'NoneType' object has no attribute 'fill'

Changing all lines with

self.page.frame(name="loginIframe")

to

self.page.frame(name="lmsSecondaryLogin")

should do the trick

Nice work with this library so far. Hoping we'll get an official Schwab API some day...

itsjafer commented 3 years ago

Thank you for opening up this issue! I've made your suggested change and tested that it works as expected. Appreciate the help :)