Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import Select
- from selenium.webdriver.common.keys import Keys
- import time
- # Initialize the WebDriver
- driver = webdriver.Chrome() # or webdriver.Firefox() if you are using Firefox
- driver.get("https://faith-freedom.com/savegirlssports")
- # Allow the page to fully load
- time.sleep(3)
- try:
- # Fill out the student name
- student_first_name = driver.find_element(By.NAME, "firstName") # Replace with correct name attribute
- student_first_name.send_keys("Jane")
- student_last_name = driver.find_element(By.NAME, "lastName") # Replace with correct name attribute
- student_last_name.send_keys("Doe")
- # Fill out the student's birthdate
- birth_month = driver.find_element(By.NAME, "month") # Replace with correct name attribute
- birth_month.send_keys("01")
- birth_day = driver.find_element(By.NAME, "day") # Replace with correct name attribute
- birth_day.send_keys("15")
- birth_year = driver.find_element(By.NAME, "year") # Replace with correct name attribute
- birth_year.send_keys("2010")
- # Select grade level
- grade_level_dropdown = Select(driver.find_element(By.NAME, "gradeLevel")) # Replace with the correct selector
- grade_level_dropdown.select_by_visible_text("5th")
- # Fill out student phone number
- student_phone = driver.find_element(By.NAME, "studentPhone")
- student_phone.send_keys("1234567890")
- # Fill out student email
- student_email = driver.find_element(By.NAME, "studentEmail")
- student_email.send_keys("jane.doe@example.com")
- # Fill out School District and Name of School
- school_district = driver.find_element(By.NAME, "schoolDistrict")
- school_district.send_keys("Example District")
- school_name = driver.find_element(By.NAME, "schoolName")
- school_name.send_keys("Example High School")
- # Select Type of School
- school_type_dropdown = Select(driver.find_element(By.NAME, "schoolType"))
- school_type_dropdown.select_by_visible_text("Public")
- # Student Athlete status
- is_student_athlete = Select(driver.find_element(By.NAME, "isAthlete"))
- is_student_athlete.select_by_visible_text("Yes")
- # Select Sport
- sport_dropdown = Select(driver.find_element(By.NAME, "sport"))
- sport_dropdown.select_by_visible_text("Basketball")
- # Transgender student in team status
- transgender_status = Select(driver.find_element(By.NAME, "transgenderStatus"))
- transgender_status.select_by_visible_text("No")
- # Parent's Information
- parent_relation = Select(driver.find_element(By.NAME, "parentRelation"))
- parent_relation.select_by_visible_text("Mother")
- parent_first_name = driver.find_element(By.NAME, "parentFirstName")
- parent_first_name.send_keys("Ann")
- parent_last_name = driver.find_element(By.NAME, "parentLastName")
- parent_last_name.send_keys("Doe")
- parent_email = driver.find_element(By.NAME, "parentEmail")
- parent_email.send_keys("ann.doe@example.com")
- parent_phone = driver.find_element(By.NAME, "parentPhone")
- parent_phone.send_keys("0987654321")
- # Agree & Sign
- student_ack = driver.find_element(By.NAME, "studentSignature") # Replace with correct name attribute
- student_ack.send_keys("Jane Doe")
- parent_ack = driver.find_element(By.NAME, "parentSignature") # Replace with correct name attribute
- parent_ack.send_keys("Ann Doe")
- # Submit the form
- submit_button = driver.find_element(By.NAME, "submit") # Replace with correct element
- submit_button.click()
- # Confirmation Page
- time.sleep(3) # Allow time for submission and possible navigation
- except Exception as e:
- print("An error occurred:", e)
- finally:
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement