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

AttributeError: 'Trading212' object has no attribute 'cookie' #9

Closed
Phalanxguard opened this issue Feb 10, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Phalanxguard
Copy link
Contributor

Phalanxguard commented Feb 10, 2022

Downloaded the latest code from the repo, seems like it's having issues getting the session cookie, this had also happened in the previous revision occasionally, but now it seems to be persistent.

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

@HellAmbro
Copy link
Owner

I just tested the code and it seems to be working, try to see the content of the cookie.

if cookie['name'] == self.session: self.cookie = f"{self.session}={cookie['value']};"
the error is related to this line of code, unfortunately there is no session name entry in your cookies.
Also try to see the value of self.session .

@HellAmbro HellAmbro added the bug Something isn't working label Feb 10, 2022
@HellAmbro HellAmbro pinned this issue Feb 10, 2022
@HellAmbro HellAmbro unpinned this issue Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants