bramton / degiro

Very basic unofficial Python API for DeGiro
BSD 3-Clause "New" or "Revised" License
52 stars 16 forks source link

Degiro api test will error in Eclipse IDE on Mac #1

Closed mgobi closed 6 years ago

mgobi commented 6 years ago

Hello Bramton, i'm interested in getting your degiro python example working. However when running the code in Eclipse on a Mac i get the following error.

Traceback (most recent call last): File "/Users/me/eclipse-workspace/degiro1/src/test_degiro.py", line 4, in la.login('config.json') File "/Users/me/eclipse-workspace/degiro1/src/degiro.py", line 23, in login self.sessid = r.headers['Set-Cookie'] File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/structures.py", line 54, in getitem return self._store[key.lower()][1] KeyError: 'set-cookie'

i tried searching online but no google results on the keyerror: 'set-cookie'.

do you know what should be done to fix the issue?

thanks for your help, best regards, Manolito

bramton commented 6 years ago

Hi, are the credentials in the config.json file correct ? And do you have a Dutch DeGiro account ? I have the impression something is wrong with logging in. Just now I have made another commit, which now prints the status_code directly after the get/post actions. Could you do a pull and try again to see the status code ?

mgobi commented 6 years ago

Hi Bramton, thanks a lot tried it immediately. Yes, i have a dutch degiro account. I get a Status code now: 403. Which translates to access forbidden.

Login Status code: 403 Traceback (most recent call last): File "/Users/me/eclipse-workspace/degiro1/src/test_degiro.py", line 4, in la.login('config.json') File "/Users/me/eclipse-workspace/degiro1/src/degiro.py", line 26, in login self.sessid = r.headers['Set-Cookie'] File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/structures.py", line 54, in getitem return self._store[key.lower()][1] KeyError: 'set-cookie'

bramton commented 6 years ago

Out of sanity, could you try logging in on the DeGiro website with the exact same credentials as in the config.json file ? Also make sure the username and password need to be inside quotes ("") in the config file.

mgobi commented 6 years ago

Hi really cool got it working now. the pwd was probably wrong. I got blocked from degiro. Now reset my password. sorry about that. excellent work with this script. will try it more.

bramton commented 6 years ago

You're welcome, and have fun playing around with it :smile: