Trying to sign into a google account using mechanicalsoup library in python. I keep getting an error that says "No valid element named identifier". But, if you look at the html for the google sign in page, you see that there is indeed an element named "identifier". Here is the code that I used:
import mechanicalsoup
browser = mechanicalsoup.StatefulBrowser()
browser.open("https://accounts.google.com/signin/v2/identifier?
continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&sacu=1&rip=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin20&flowName=GlifWebSignIn&flowEntry=ServiceLogin")
browser.select_form("form")
browser['identifier'] = "username"
browser.submit_selected()
Sorry for the cut in the middle of the code. I couldn't correctly indent the lines to make it more neat. Oh, and here is the entire error message:
Traceback (most recent call last): File "C:/Users/joldb/PycharmProjects/chatroom/testing.py", line 9, in browser['identifier'] = "username" File "C:\Users\joldb\PycharmProjects\chatroom\venv\lib\site-packages\mechanicalsoup\stateful_browser.py", line 103, in setitem self.get_current_form()[name] = value File "C:\Users\joldb\PycharmProjects\chatroom\venv\lib\site-packages\mechanicalsoup\form.py", line 237, in setitem return self.set(name, value) File "C:\Users\joldb\PycharmProjects\chatroom\venv\lib\site-packages\mechanicalsoup\form.py", line 278, in set raise LinkNotFoundError("No valid element named " + name) mechanicalsoup.utils.LinkNotFoundError: No valid element named identifier