1# The same code that Homeless Horse wrote but in Python
2
3from selenium import webdriver # pip install selenium to work
4from selenum.webdriver.common.keys import Keys
5driver = webdriver.Chrome() # Specifying which browser to use
6driver.get("https://www.google.com") # The url of the website to visit
7element = driver.find_element_by_name("q") # Find the searchbar element which has the name "q"
8element.send_keys("BrowserStack") # Send in the word "BrowserSTack"
9element.send_keys(Keys.RETURN) # Send in the Return Key(Enter Key)
10print(driver.title) # Print the title of the webpage in the console
11driver.quit() # Close the webdriver