I am trying to fill in the search input type box with value "fab" and then I want to display the next url with that keyword but I am getting this error for element not interactable. How can I solve this?
from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome(executable_path='C:\\Users\\Mansi Dhingra\\Downloads\\chromedriver') driver.get("https://www.thenational.ae/search?q=") print(driver.title) driver.implicitly_wait(10) search_bar = driver.find_element_by_xpath('//input[@name="q"]') print(search_bar) search_bar.clear() search_bar.send_keys("fab") search_bar.send_keys(Keys.RETURN) print(driver.current_url) driver.close() Error:-
Traceback (most recent call last): File "C:/Users/Mansi Dhingra/Desktop/Projects/api/news/news_python.py", line 10, in search_bar.clear() File "C:\Users\Mansi Dhingra\Desktop\Projects\api\venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 95, in clear self._execute(Command.CLEAR_ELEMENT) File "C:\Users\Mansi Dhingra\Desktop\Projects\api\venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute return self._parent.execute(command, params) File "C:\Users\Mansi Dhingra\Desktop\Projects\api\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\Mansi Dhingra\Desktop\Projects\api\venv\lib\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: chrome=81.0.4044.92)