I'm hoping to eventually set up a bot to trade paper stocks for me in WeBull. I'm working with code offered up by a youtube comrade: https://github.com/Jake0303/Webull-Trading-Bot/blob/master/WebullBot.py. I've saved it in my anaconda3 folder as 'TradingBotRedux.py'
I'm just trying to get it up and running, for which I will need it to be able to log in to WeBull. So my goal is for it to request my email address and password to login for the first time--but the next time it should remember my info. (Really, I would not mind entering my info every time I run it). The following is what occurs:
In anaconda navigator, I open CMD.exe Prompt. Then:
(MyEnvironment) C:\Users\XXX>python "C:\Users\XXX\anaconda3\TradingBotRedux.py"
Logging in to WeBull...
Traceback (most recent call last):
File "C:\Users\XXX\anaconda3\TradingBotRedux.py", line 101, in <module>
if not loginInfo['accessToken'] is None and len(loginInfo['accessToken']) > 1:
KeyError: 'accessToken'
It used to say
Logging in to WeBull...
First time login.
Enter MFA Code :
but I accidentally entered my password when I think it wanted my email address.
I've tried a few things, like exchanging my real email address in lines 40, 42, and 48. I also tried creating a .txt file called 'token' (as this is referenced in line 29) but I wasn't sure what to put in it. For both of these, running the TradingBotRedux.py yields the same message as above.
Line 101 looks fine to me; idk how to proceed. Would greatly appreciate your help!
This looks relevant but I'm too new to coding to fit the puzzle pieces together: https://www.nylas.com/blog/use-python-requests-module-rest-apis/