The code below is not working. When I execute the code, its runs perfectly except this line:
driver.find_element_by_name("btnK").send_keys(Keys.ENTER)
Even though the line doesn't run it still doesn't give an error. The error is that the line of code doesn't click the button with the name, 'btnK'.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Chrome()
driver.set_page_load_timeout(10)
driver.get("https://www.google.com")
driver.find_element_by_name('q').send_keys("Automation Step by Step")
time.sleep(1)
driver.find_element_by_name("btnK").send_keys(Keys.ENTER)
driver.maximize_window()
time.sleep(2)
driver.quit()