3

Getting error of

selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable

(or)

selenium.common.exceptions.WebDriverException: Message: chrome not reachable for the search query code lines.

I believe that search field is hidden in the website. Help with the code.

from selenium import webdriver  
from selenium.webdriver.common.by import By  
from selenium.webdriver.support.ui import WebDriverWait  
from selenium.webdriver.support import expected_conditions as EC  
from selenium.common.exceptions import TimeoutException  
from selenium.webdriver.common.keys import Keys

#Step: Create new browsing session
options = Options()  
options.add_argument("start-maximized")   
browser = webdriver.Chrome("C:/Users/ashita.gadagotti/Downloads/chromedriver_win32/chromedriver.exe",chrome_options=options) 

#Search Query    
browser.get("https://equiniti-kyc.com")   
search_input = browser.findElement(By.className("primary-navigation__search-input").isEnabled()  
search_input.send_keys('ISO')  
search_input.submit()
barbsan
  • 3,418
  • 11
  • 21
  • 28

1 Answers1

1

Yes It will show ElementNotInteractableException because first you need to click on search button which show at right side of your website than, It will enabled search box and than you need to use send keys and press button.

 browser.find_element_by_xpath("//i[@class='primary-navigation__list-item-link-icon-search']//*[@class='icon']").click()

Then you need to use send keys for your search input.

 search_input =browser .find_element_by_xpath("//div[@class='primary-navigation__search-container primary-navigation__search-container--shown']//input[@placeholder='Search']")
 search_input.send_keys('ISO') 

Then again you need to click on search button so all result will shown on your screen

browser.find_element_by_xpath("//div[@class='primary-navigation__search-container primary-navigation__search-container--shown']//input[@value='GO']").click()

Here i used absolute xpath but you can use dynamic xpath. It will not work with class name because same class name assigned to other elements. so it will create confusion for which element should selected. use Absolute xpath or dynamic xpath in such cases.

Dhru 'soni
  • 1,024
  • 7
  • 23