Skip to content Skip to sidebar Skip to footer

Elementnotinteractableexception Error When Using Headless Option

I get error when i try and run say below code. Error is ElementNotInteractableException: Message: element not interactable (Session info: headless chrome=83.0.4103.116) This seem

Solution 1:

Try setting the window size as well as being headless. Add this:

chromeOptions.add_argument("--window-size=1920,1080")

The default size of the headless browser is tiny. If the code works when headless is not enabled it might be because your object is outside the window.

[edit - updated based feedback that the the above didn't working]

Answering your question rather than trying solving your issue.

Either add this to your options:

--remote-debugging-port=9222

Or run chrome (without chromedriver) locally:

chrome --headless --remote-debugging-port=9222 --disable-gpu https://www.google.com

Then open a new chrome (or tab) and go to http://localhost:9222/

You'll get a link to open your page - click on that you'll get devtools for that remote instance: Chrome remote debug

Post a Comment for "Elementnotinteractableexception Error When Using Headless Option"