Nosuchelementexception: No Such Element: Unable To Locate Element: {"method":"name","selector":"btnk"}
from selenium import webdriver import time from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome(r'C:\Users\m\Desktop\python\selen\chromedriver.exe') driver.se
Solution 1:
That should be solved your problem :
from selenium import webdriver
import time
from selenium.webdriver.common.keysimportKeys
driver = webdriver.Chrome("/usr/bin/chromedriver")
driver.set_page_load_timeout(10)
driver.get("https://google.com")
search = driver.find_element_by_name('q')
search.send_keys("google search through python")
search.send_keys(Keys.RETURN)
time.sleep(4)
driver.quit()
I tested in Ubuntu + chrome browser
Replace your code
driver.find_element_by_name("q").send_keys("Automation")
driver.find_element_by_name("btnk").send_keys(Keys.ENTER)
To =>
search = driver.find_element_by_name('q')
search.send_keys("google search through python")
search.send_keys(Keys.RETURN)
Post a Comment for "Nosuchelementexception: No Such Element: Unable To Locate Element: {"method":"name","selector":"btnk"}"