Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import selenium, sys
- from selenium import webdriver
- def Firefox_get():
- global driver
- driver = webdriver.Firefox()#calls gecko driver
- driver.maximize_window()
- def Chrome_get():
- global driver
- driver = webdriver.Chrome()
- driver.maximize_window()
- def Quitting():
- driver.quit()
- sys.exit()
- def URL_Entry():
- global where
- where = input("Please type in the url for the website you wish to visit. ")
- driver.get('%s') % (where)#tells driver what URL to open
- def HTML_ID():
- global html_id, message
- html_id = input("Please enter the html ID of the form field you wish to type into. ")
- message = input ("Please enter the information you with to type into the selcted field ")
- driver.find_element_by_id("%s").send_keys("%s") %(html_id, message)
- def By_Name_Button():
- global name
- name = input("Please enter the name identifier for the button you wish to press. ")
- driver.find_element_by_name("%s").click()%(name)#finds the search button and emulates a left mouse click
- def By_Partial_Text():
- global partial_text
- partial_text = input("Please type in the information you wish to seek then select. ")
- driver.find_element_by_partial_link_text("%s").click()%(partial_text)
- def Screen_Shots():
- global path_name
- path_name = input ("Please enter the file path and name of the screen shot's save location. ")
- driver.get_screenshot_as_file("%s")%(path_name)#saves a screen shot to the project folder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement