Skip to content

Commit

Permalink
Merge pull request #96 from smkent/optional-remember-me-checkbox
Browse files Browse the repository at this point in the history
Skip Keep Me Signed In checkbox if not present during login
  • Loading branch information
smkent authored Jul 13, 2023
2 parents 6583fd6 + 049ecdd commit 5ddd2b8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions safeway_coupons/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,18 @@ def _login(self, account: Account) -> None:
account.password
)
time.sleep(0.5)
print("Deselect Keep Me Signed In")
driver.find_element(
By.XPATH, "//span [contains(text(), 'Keep Me Signed In')]"
).click()
time.sleep(0.5)
try:
driver.find_element(
By.XPATH,
"//span [contains(text(), 'Keep Me Signed In')]",
).click()
print("Deselect Keep Me Signed In")
time.sleep(0.5)
except NoSuchElementException:
print(
"Skipping Keep Me Signed In checkbox "
"which is not present"
)
print("Click Sign In button")
driver.find_element("id", "btnSignIn").click()
time.sleep(0.5)
Expand Down

0 comments on commit 5ddd2b8

Please sign in to comment.