When running chrome headless with python selenium, I got an error with send_keys, so I will write a method to deal with it.
I got an error with send_keys even though I matched the versions of chrome and chromedriver-binary. There was an article that worked in the past version, but it doesn't work for some reason. I didn't want to lower the chrome version just for this, so I called java.
I think it's just an example
When not headless
element = driver.find_element_by_name("password")
element.send_keys(""" password """)
This is the method of specifying send_keys in the name tag. This will throw an error, so I did the following.
When headless
password = """ password """
driver.execute_script('document.getElementsByTagName("input")[3].value="%s";' % password)
Since an error occurred when "password" was specified in the name tag, the fourth input tag is specified.
It may be good to run java using driver.execute_script where it fits while verifying the page like this.