From 93bb634f7c3c38035ec6a0b6e65bf9670b2cda80 Mon Sep 17 00:00:00 2001 From: piair Date: Thu, 6 Apr 2023 23:41:11 +0200 Subject: [PATCH] some fixes here and there --- V5.py | 10 +++++----- version | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/V5.py b/V5.py index 2d07a2f..7fa5e94 100755 --- a/V5.py +++ b/V5.py @@ -298,7 +298,7 @@ def all_cards(): # return to the main page and closes all other tabs # break def top_cards(): - for _ in range(10): + for _ in range(2): try : driver.find_element(By.XPATH, "/html/body/div/div/div[3]/div[1]/div/div[1]/div[2]").click() reset() @@ -307,8 +307,8 @@ def all_cards(): # return to the main page and closes all other tabs break try : - top_cards() - print("top card") + #top_cards() + print("top card not working really well right now. Disableing them") except Exception as e: log_error(e) @@ -670,7 +670,6 @@ def fidelity(): fidelity_link = fidelity_link_page.content.decode("UTF-8") if (fidelity_link.split(":")[0] == "https") or (fidelity_link.split(":")[0] == "http") : - driver.get(fidelity_link) wait_until_visible(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]', browser=driver) try : @@ -683,9 +682,10 @@ def fidelity(): answer_number = search("([0-9]) de ([0-9]) finalisé", driver.page_source) if answer_number is None : answer_number = search("([0-9]) licence\(s\) sur ([0-9]) disponible\(s\)", driver.page_source) + if answer_number is None : + answer_number = search("([0-9]) défi\(s\) terminé\(s\) sur ([0-9])", driver.page_source) if answer_number is None : answer_number = [0,0,0] - for _ in range(int(answer_number[2]) - int(answer_number[1])): driver.refresh() custom_sleep(2) diff --git a/version b/version index 3549893..dd12356 100644 --- a/version +++ b/version @@ -1 +1 @@ -v5.2.4 +v5.2.5