from time import sleep from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys def gecko_test(): # Set the driver driver = webdriver.Firefox() driver.get("https://duck.com") elem = driver.find_element(By.NAME, "q") elem.send_keys("seleniumhq" + Keys.RETURN) sleep(5) driver.quit() if __name__ == "__main__": gecko_test()