some fixes here and there

This commit is contained in:
piair 2023-04-06 23:41:11 +02:00
parent 31426a1dfd
commit 93bb634f7c
2 changed files with 6 additions and 6 deletions

10
V5.py
View File

@ -298,7 +298,7 @@ def all_cards(): # return to the main page and closes all other tabs
# break # break
def top_cards(): def top_cards():
for _ in range(10): for _ in range(2):
try : try :
driver.find_element(By.XPATH, "/html/body/div/div/div[3]/div[1]/div/div[1]/div[2]").click() driver.find_element(By.XPATH, "/html/body/div/div/div[3]/div[1]/div/div[1]/div[2]").click()
reset() reset()
@ -307,8 +307,8 @@ def all_cards(): # return to the main page and closes all other tabs
break break
try : try :
top_cards() #top_cards()
print("top card") print("top card not working really well right now. Disableing them")
except Exception as e: except Exception as e:
log_error(e) log_error(e)
@ -670,7 +670,6 @@ def fidelity():
fidelity_link = fidelity_link_page.content.decode("UTF-8") fidelity_link = fidelity_link_page.content.decode("UTF-8")
if (fidelity_link.split(":")[0] == "https") or (fidelity_link.split(":")[0] == "http") : if (fidelity_link.split(":")[0] == "https") or (fidelity_link.split(":")[0] == "http") :
driver.get(fidelity_link) driver.get(fidelity_link)
wait_until_visible(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]', browser=driver) wait_until_visible(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]', browser=driver)
try : try :
@ -683,9 +682,10 @@ def fidelity():
answer_number = search("([0-9]) de ([0-9]) finalisé", driver.page_source) answer_number = search("([0-9]) de ([0-9]) finalisé", driver.page_source)
if answer_number is None : if answer_number is None :
answer_number = search("([0-9]) licence\(s\) sur ([0-9]) disponible\(s\)", driver.page_source) 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 : if answer_number is None :
answer_number = [0,0,0] answer_number = [0,0,0]
for _ in range(int(answer_number[2]) - int(answer_number[1])): for _ in range(int(answer_number[2]) - int(answer_number[1])):
driver.refresh() driver.refresh()
custom_sleep(2) custom_sleep(2)

View File

@ -1 +1 @@
v5.2.4 v5.2.5