I have a python3 selenium script on Ubuntu running in chrome successfully when I attempt to run headless it errors out on element not being interactable:
Traceback (most recent call last):
File "file.py", line 143, in <module>
driver.find_element_by_xpath('//*[@id="ctl00_MainContent_MyReportViewer_ctl04_ctl00"]').click()
File "/home/jobs/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "/home/jobs/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "/home/jobs/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/jobs/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: headless chrome=87.0.4280.88
I'd seen a post on that it might be how chrome interacts with objects differently so I've tried this with Firefox as well with the same results.
The only line I'm changing is:
chrome_options.add_argument("--headless")