1#Python example - use chrome driver to open google url and enter into search bar "Why is python so awesome"
2
3#required imports
4from selenium import webdriver
5from selenium.webdriver.common.keys import Keys
6
7#open driver
8PATH_TO_DRIVER = './chromedriver'
9driver = webdriver.Chrome(executable_path=PATH_TO_DRIVER)
10
11#launch url using driver
12driver.get('https://google.com')
13
14#find element to manipulate e.g. by element name. 'q' is the element name of the google search bar
15element = driver.find_element_by_name('q')
16
17#write text into search bar
18element.send_keys('Why is python so awesome')
19
20#simulates 'Enter' key
21element.send_keys(Keys.ENTER)