Skip to content

Commit

Permalink
Merge branch 'master' into 854-feature-request-rewrite-webscraper-to-…
Browse files Browse the repository at this point in the history
…use-catalog-api
  • Loading branch information
bnavac committed Dec 9, 2023
2 parents 6dd6fde + 0f00a6f commit 3d78120
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rpi_data/modules/headless_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ def login(driver):
username_box.send_keys(username)
password_box.send_keys(password)
submit.click()
while len(driver.find_elements(By.XPATH, '/html/body/div/div/div[1]/div/div[2]/div[3]'))==0:
while len(driver.find_elements(By.XPATH, '/html/body/div/div/div[1]/div/div[2]/div[7]/a'))==0:
time.sleep(.1)
options = driver.find_element(By.XPATH, '/html/body/div/div/div[1]/div/div[2]/div[7]/a')
options.click()
while len(driver.find_elements(By.XPATH, '/html/body/div/div/div[1]/div/div[1]/ul/li[1]/a')) == 0:
time.sleep(.1)
duo_option = driver.find_element(By.XPATH, '/html/body/div/div/div[1]/div/div[1]/ul/li[1]/a')
duo_option.click()
while len(driver.find_elements(By.XPATH, '/html/body/div/div/div[1]/div/div[2]/div[3]')) == 0:
time.sleep(.1)
print("Your DUO code: "+ driver.find_element(by= By.XPATH, value = "/html/body/div/div/div[1]/div/div[2]/div[3]").text) # print the duo code
while len(driver.find_elements(By.XPATH, '//*[@id="trust-browser-button"]'))==0: # we need to press the trust browser button, so we wait until that shows up
Expand Down

0 comments on commit 3d78120

Please sign in to comment.