timkpaine / tdameritrade

Python interface to TD Ameritrade (https://developer.tdameritrade.com)
Apache License 2.0
520 stars 202 forks source link

Fix auth method #164

Closed CompoTypo closed 2 years ago

CompoTypo commented 2 years ago

I am trying to use the authentication method to help automate my process and minimize user intervention.

I ran into an issue with the Selenium interactions and made some simple changes to the bothersome code that should make it version proof (at least for now).

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/riga/Projects/Trading/src/main.py", line 31, in td_auth_test
    client = get_session()
  File "/home/riga/Projects/Trading/src/services/tdameritrade.py", line 13, in get_session
    resp = authentication(
  File "/home/riga/.cache/pypoetry/virtualenvs/src-AaSltELY-py3.10/lib/python3.10/site-packages/tdameritrade/auth/__init__.py", line 47, in authentication
    ubox = driver.find_element_by_id('username')
AttributeError: 'WebDriver' object has no attribute 'find_element_by_id'

Please let me know if there are any issues on my end i should fix for this PR.

codecov[bot] commented 2 years ago

Codecov Report

Merging #164 (991a4bb) into main (e32571b) will decrease coverage by 0.07%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
- Coverage   77.38%   77.31%   -0.08%     
==========================================
  Files          28       28              
  Lines        1101     1102       +1     
  Branches      151      151              
==========================================
  Hits          852      852              
- Misses        234      235       +1     
  Partials       15       15              
Impacted Files Coverage Δ
tdameritrade/auth/__init__.py 16.94% <0.00%> (-0.30%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us.

CompoTypo commented 2 years ago

Will unittest shortly