ElementNotInteracable Exception for Selenium Chrome webdriver

emagnun soorajspadmanabhan at gmail.com
Sat Jun 6 13:21:41 EDT 2020


I'm using latest python and latest Selenium chrome webdriver. I'm trying to have a simple code to search in youtube but I'm getting the below error. Can anyone help me?

File "search.py", line 8, in searchBox.click()
Selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable

#MyCodeStartsHere
from selenium import webdriver

driver = webdriver.Chrome()
driver.get('https://youtube.com')

searchBox = driver.find_element_by_xpath('//*[@id="search"]')
if searchBox.is_enabled():
    searchBox.click()
    searchBox.send_keys("youtube test")
    searchButton = driver.find_element_by_xpath('//*[@id="search-icon-legacy"]/yt-icon')
    searchButton.click()
else:
    print("What the heck")
#MyCodeEndsHere


More information about the Python-list mailing list