My code is working all fine when I don't run chrome in headless mode, but in headless mode I get 'Element not interactable'.
I get error at email_box.send_keys('')
And I have set the window size, still it is not working
Code:
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
import time
options = Options()
options.add_argument('headless')
options.add_argument('window-size=1366x768')
with Chrome(options=options) as driver:
driver.get('https://accounts.google.com/login')
WebDriverWait(driver, 20).until(lambda d: d.find_element(By.TAG_NAME, 'input'))
time.sleep(2)
email_box = driver.find_element(By.TAG_NAME, 'input')
time.sleep(2)
email_box.send_keys('[email protected]')