#@Author Connor Barnhart
# Takes in a topic to search and opens the first result
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time, sys

search = input('Please enter your search: ')
browser = webdriver.Firefox()
browser.get('https://www.google.com/')
time.sleep(3) #Waits for page to load

searchBar = browser.find_element_by_id('lst-ib')
searchBar.click()
searchBar.send_keys(search)
time.sleep(1)
searchBar.send_keys(Keys.ENTER)

time.sleep(3) #Wait for page to load
firstLink = browser.find_element_by_xpath('//*[@id="rso"]/div/div/h3/a')
firstLink.click()

sys.exit()

2731faed8f0e40b7d835f70d14f6aea3bbf053e5
<mask token>

<mask token>
browser.get('https://www.google.com/')
time.sleep(3)
<mask token>
searchBar.click()
searchBar.send_keys(search)
time.sleep(1)
searchBar.send_keys(Keys.ENTER)
time.sleep(3)
<mask token>
firstLink.click()
sys.exit()

<mask token>
search = input('Please enter your search: ')
browser = webdriver.Firefox()
browser.get('https://www.google.com/')
time.sleep(3)
searchBar = browser.find_element_by_id('lst-ib')
searchBar.click()
searchBar.send_keys(search)
time.sleep(1)
searchBar.send_keys(Keys.ENTER)
time.sleep(3)
firstLink = browser.find_element_by_xpath('//*[@id="rso"]/div/div/h3/a')
firstLink.click()
sys.exit()

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time, sys
search = input('Please enter your search: ')
browser = webdriver.Firefox()
browser.get('https://www.google.com/')
time.sleep(3)
searchBar = browser.find_element_by_id('lst-ib')
searchBar.click()
searchBar.send_keys(search)
time.sleep(1)
searchBar.send_keys(Keys.ENTER)
time.sleep(3)
firstLink = browser.find_element_by_xpath('//*[@id="rso"]/div/div/h3/a')
firstLink.click()
sys.exit()

#@Author Connor Barnhart
# Takes in a topic to search and opens the first result
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time, sys

search = input('Please enter your search: ')
browser = webdriver.Firefox()
browser.get('https://www.google.com/')
time.sleep(3) #Waits for page to load

searchBar = browser.find_element_by_id('lst-ib')
searchBar.click()
searchBar.send_keys(search)
time.sleep(1)
searchBar.send_keys(Keys.ENTER)

time.sleep(3) #Wait for page to load
firstLink = browser.find_element_by_xpath('//*[@id="rso"]/div/div/h3/a')
firstLink.click()

sys.exit()
