updated css selectors for new page
This commit is contained in:
parent
22701a90a7
commit
1c22b7df2b
10
main.py
10
main.py
@ -185,7 +185,7 @@ def doLogin() -> None:
|
|||||||
|
|
||||||
driver.get(config["gateway"])
|
driver.get(config["gateway"])
|
||||||
wait = WebDriverWait(driver, 9999)
|
wait = WebDriverWait(driver, 9999)
|
||||||
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "img[alt=Logo],img[alt=logo]")))
|
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'img[alt="app logo"]')))
|
||||||
|
|
||||||
closeBrowser(driver, dkey)
|
closeBrowser(driver, dkey)
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ driver.get(url)
|
|||||||
wait = WebDriverWait(driver, timeout)
|
wait = WebDriverWait(driver, timeout)
|
||||||
wait.until(AnyEc(
|
wait.until(AnyEc(
|
||||||
EC.url_contains("microsoft"),
|
EC.url_contains("microsoft"),
|
||||||
EC.presence_of_element_located((By.CSS_SELECTOR, "img[alt=Logo],img[alt=logo]"))
|
EC.presence_of_element_located((By.CSS_SELECTOR, 'img[alt="app logo"]'))
|
||||||
))
|
))
|
||||||
|
|
||||||
if "microsoft" in driver.current_url:
|
if "microsoft" in driver.current_url:
|
||||||
@ -217,7 +217,7 @@ if "microsoft" in driver.current_url:
|
|||||||
driver.get(url)
|
driver.get(url)
|
||||||
wait = WebDriverWait(driver, timeout)
|
wait = WebDriverWait(driver, timeout)
|
||||||
|
|
||||||
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "img[alt=Logo],img[alt=logo]")))
|
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'img[alt="app logo"]')))
|
||||||
|
|
||||||
driver.implicitly_wait(0)
|
driver.implicitly_wait(0)
|
||||||
continueBtn = driver.find_elements(By.ID, "btnContinue")
|
continueBtn = driver.find_elements(By.ID, "btnContinue")
|
||||||
@ -228,7 +228,7 @@ if len(continueBtn) > 0:
|
|||||||
infoLogger.log("Detected session already running button")
|
infoLogger.log("Detected session already running button")
|
||||||
continueBtn.click()
|
continueBtn.click()
|
||||||
|
|
||||||
wait.until(EC.presence_of_element_located((By.ID, "table_welcome_2")))
|
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, ".welcomeMessageText")))
|
||||||
|
|
||||||
infoLogger.log("Extracting cookies...")
|
infoLogger.log("Extracting cookies...")
|
||||||
DSID = driver.get_cookie("DSID")["value"]
|
DSID = driver.get_cookie("DSID")["value"]
|
||||||
@ -257,4 +257,4 @@ if re.match(r"[a-f0-9]{32}", DSID):
|
|||||||
else:
|
else:
|
||||||
errorLogger.log(f"VPN stopped unexpectedly (code: {proc.returncode})")
|
errorLogger.log(f"VPN stopped unexpectedly (code: {proc.returncode})")
|
||||||
else:
|
else:
|
||||||
errorLogger.log(f"Invalid DSID cookie format: {DSID}")
|
errorLogger.log(f"Invalid DSID cookie format: {DSID}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user