I've been trying to search this website 'https://mol.org/regions/?regiontype=countries'. But I keep getting the ElementNotInteractableException. I've tried a lot of methods online but nothing seems to work. Here is my latest approach:
search_query = 'Egypt'
search_bar_XPath = '//div[@class="region-search"]/div/input[1]'
with webdriver as driver:
wait = WebDriverWait(driver, 10)
driver.get(url)
wait.until(presence_of_element_located((By.CLASS_NAME, 'region-search')))
search_bar = driver.find_element_by_xpath(search_bar_XPath)
ActionChains(driver).move_to_element(search_bar).click().perform()
wait.until(EC.element_to_be_clickable((By.XPATH, search_bar_XPath))).send_keys(search_query + Keys.RETURN)
driver.close()
I can't figure out why the search bar is present but yet not interactable nor accessible.