For context I am working on a way to automate getting specific bits of information from my company's bookings engine. I'm using selenium to log into the bookings engine and navigate to the relevant pages to get the information I want. I want to be able to do this without opening an actual visible browser window.
I have been working with a visible browser for the purposes of helping me actually see what the code was doing when I run it making it easier to fix bugs. However when I tried to run it with a headless browser I suddenly got an element not interactable exception. Here's the relevant parts of my code.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
option = webdriver.ChromeOptions()
option.add_argument('headless')
driver = webdriver.Chrome(ChromeDriverManager().install(), options=option)
My code is identical to what it was before. The only thing I have changed is the addition of the 'headless' argument to the options. Anyone know why this would cause some elements to not be interactable and how to fix it?