From 1c22b7df2b99d5ee94723f4cf36af48e013b4175 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 5 Apr 2025 23:20:27 +0200 Subject: [PATCH] updated css selectors for new page --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 449553a..eaf8766 100644 --- a/main.py +++ b/main.py @@ -185,7 +185,7 @@ def doLogin() -> None: driver.get(config["gateway"]) 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) @@ -206,7 +206,7 @@ driver.get(url) wait = WebDriverWait(driver, timeout) wait.until(AnyEc( 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: @@ -217,7 +217,7 @@ if "microsoft" in driver.current_url: driver.get(url) 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) continueBtn = driver.find_elements(By.ID, "btnContinue") @@ -228,7 +228,7 @@ if len(continueBtn) > 0: infoLogger.log("Detected session already running button") 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...") DSID = driver.get_cookie("DSID")["value"] @@ -257,4 +257,4 @@ if re.match(r"[a-f0-9]{32}", DSID): else: errorLogger.log(f"VPN stopped unexpectedly (code: {proc.returncode})") else: - errorLogger.log(f"Invalid DSID cookie format: {DSID}") \ No newline at end of file + errorLogger.log(f"Invalid DSID cookie format: {DSID}")