When I run my script it gives me this error:
Traceback (most recent call last):
File “C:DevelopmentPython_ProjectSDETpythonProjectSDET_Packagemy_firstProject.py”, line 18, in <module>
search.send_keys(keys.RETURN)
AttributeError: module ‘selenium.webdriver.common.keys’ has no attribute ‘RETURN’
Here is my code:
from selenium import webdriver
import selenium
from selenium.webdriver.common import keys
import time
# this will load googlechrome from the location in C-drive
PATH = “C:Program Files (x86)chromedriver.exe”
driver = webdriver.Chrome(PATH)
driver.get(“https://techwithtim.net”)
print(driver.title) # print the title of the page
search = driver.find_element_by_name(“s”)
search.send_keys(“test”)
search.send_keys(keys.RETURN)
time.sleep(5)
driver.close() # close the browser
Source: Read More