Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from ordinall/master
Browse files Browse the repository at this point in the history
Fixed selenium webdriver functions and cleanup after success
  • Loading branch information
adistomar authored Sep 16, 2022
2 parents 8f83253 + d76ca1d commit 7ea00e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions snapstreak_revive/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
""" website specific IDs - do not modify"""

URL = "https://support.snapchat.com/en-GB/i-need-help"
SUCCESS_URL = "https://support.snapchat.com/en-GB/success"
HELP_OPTION_ID = "5695496404336640"
USERNAME_INPUT_ID = "field-24281229"
EMAIL_INPUT_ID = "field-24335325"
Expand Down Expand Up @@ -117,9 +118,9 @@ def main():

# hourglass icon
time.sleep(0.2)
hourglass_dropbox = (driver.find_elements_by_tag_name(DROPDOWN_HOURGLASS_TAG))[LAST].click()
hourglass_dropbox = (driver.find_elements(By.TAG_NAME, DROPDOWN_HOURGLASS_TAG))[LAST].click()
time.sleep(0.2)
dropbox_no_option = driver.find_element_by_xpath(DROPDOWN_DATA_VALUE_CLASS).click()
dropbox_no_option = driver.find_element(By.XPATH, DROPDOWN_DATA_VALUE_CLASS).click()

# details
information_input = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.ID, INFORMATION_INPUT_ID)))
Expand All @@ -128,4 +129,5 @@ def main():
# submit button
submit_button = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.ID, SUBMIT_BUTTON_ID))).click()

time.sleep(1000)
WebDriverWait(driver, 1000).until(lambda driver: driver.current_url == SUCCESS_URL)
driver.quit()

0 comments on commit 7ea00e3

Please sign in to comment.