1

I'm running the following script to make a search for books on this webpage:

from selenium import web-driver
from selenium.webdriver.common.keys import Keys
import time

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)

#going to a website
driver.get("https://pacobello.com.br/")

#print the page title
print(driver.title)

search = driver.find_element_by_name("s")
search.send_keys("Saramago")
search.send_keys(Keys.RETURN)

time.sleep(5)

#quit a tab
#driver.close()

#quit the browser
driver.quit()

And I'm getting the following error:

raise exception_class(message, screen, stacktrace)

ElementNotInteractableException: element not interactable
  (Session info: chrome=84.0.4147.125)

Does anyone have an idea about this?

Deepak Kumar
  • 1,246
  • 14
  • 38
  • Hi Thiago! Check my answer and let me know if it worked ! – Marios Aug 12 '20 at 15:49
  • Please go through the below link let me know if it helped. [There was same kind of query and it is been addressed detailed in this link](https://stackoverflow.com/questions/49864965/org-openqa-selenium-elementnotinteractableexception-element-is-not-reachable-by) – Bhuvaneshwari K Aug 12 '20 at 16:56

2 Answers2

1

Use XPATH instead:

search = driver.find_element_by_xpath("//input[@type='text']")

Therefore the complete code will be:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time


PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)

#going to a website
driver.get("https://pacobello.com.br/")

#print the page title
print(driver.title)

search = driver.find_element_by_xpath("//input[@type='text']")
search.send_keys("Saramago")
search.send_keys(Keys.RETURN)

time.sleep(5)

#quit a tab
#driver.close()

#quit the browser
driver.quit()
Marios
  • 26,333
  • 8
  • 32
  • 52
  • @ThiagoOliveira Please consider also to vote up if you like :) it would help a lot ! Thanks – Marios Aug 12 '20 at 18:32
0

install 83 version of chrome not 84

https://chromedriver.chromium.org/downloads

hi1
  • 36
  • 4