0
Hello, I’m starting to use Selenium. I started trying to access google and some basic commands. However I can’t use click(). My show:
from selenium import webdriver
class Google(object):
def __init__(self, driver):
self.driver = driver
self.url = 'http://google.com'
self.search_bar = 'q'
self.btn_search = 'btnK'
self.btn_lucky = 'btnI'
def navigate(self):
self.driver.get(self.url)
def search(self):
self.pesquisa = 'sabonete'
self.driver.find_element_by_name(self.search_bar).send_keys(self.pesquisa)
self.driver.find_element_by_name('btnI').click()
gg = webdriver.Chrome()
g = Google(gg)
g.navigate()
g.search()
Error:
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: chrome=81.0.4044.138)
Yes. That was on purpose, I did not execute the
driver.quit()
, purpose so the guy can see the result on screen, and close manually after checking that the command has been executed successfully. I can edit my reply and make that information explicit.– Danizavtz