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

'Trading212' object has no attribute 'cookie' #7

Closed
Phalanxguard opened this issue Feb 8, 2022 · 1 comment
Closed

'Trading212' object has no attribute 'cookie' #7

Phalanxguard opened this issue Feb 8, 2022 · 1 comment

Comments

@Phalanxguard
Copy link
Contributor

I've fixed some issues in the last pull request, but there is still an issue somewhere with cookies that I can't resolve. The error displays the following message shortly after successful login:

trading212 = Trading212(email, password, driver, mode=Mode.DEMO, trading=Trading.CFD)
File "C:\Python310\lib\site-packages\pytrading212\trading212.py", line 113, in init
"Cookie": self.cookie,
AttributeError: 'Trading212' object has no attribute 'cookie'

@Phalanxguard
Copy link
Contributor Author

Adding a wait time before getting the session cookie seems to resolve the issue:

get session cookie

    time.sleep(1) #Let the cookies arrive!
    cookies = self.driver.get_cookies()
    if cookies is not None:
        for cookie in cookies:

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

1 participant