I have to login into the same Microsoft Form everyday to fill out and I know I wont remeber do due this, so I'm trying to automate it. Problem with this is that MS Forms has no API for filling out forms and I have to login with my MS account.
Currently my code looks like this. From what I can tell it logins, but gets stuck at a redirect page between the login and the form. (I know password is not secured. I'm still looking into that.)
session = requests.Session()
login_data = {
'login': EMAIL,
'passwd': PASSWORD,
'submit': 'login',
}
form_content = ''
with session as c:
c.post( LOGIN_URL, data = login_data )
form_content = c.get( FORM_URL )
From what I can tell this works for login, but if I have a browser on my computer logged in to microsoft it will give me a connection error. If It succeeds to login and I try to access the MS Form, it sends me to a redirect page (see image below) where I'm stuck. Any ideas on how to procced or if there is a better way of doing this?
I have downloaded the MS form page as an HTML file if that can help.
ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))