From 7da5bf2a80839e5de27905d8bc0078ce93f1e597 Mon Sep 17 00:00:00 2001 From: piair Date: Wed, 18 May 2022 19:07:25 +0200 Subject: [PATCH] try to catch an error that append in the first account --- V4.py | 37 +++++++++++++++++++++++++------------ config | 11 +++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/V4.py b/V4.py index b7776e3..9224dab 100755 --- a/V4.py +++ b/V4.py @@ -394,7 +394,8 @@ def AllCard(): # fonction qui clique sur les cartes dailyCards() except: printf("erreur ici") - try: + + def weekly_cards() : try: driver.find_element( By.XPATH, "/html/body/div/div/div[3]/div[2]/div[2]/div[2]/div[1]" @@ -428,8 +429,16 @@ def AllCard(): # fonction qui clique sur les cartes ] # verifie si on a toujours des cartes except: break - except Exception as e: - LogError(f"2eme partie de AllCard (weekly card)\n {e}") + for i in range(3) : + try : + weekly_cards() + except Exception as e: + LogError(f"weekly_cards, try n°{i} \n {e}") + if i == 0 : + driver.refresh() + else : + CustomSleep(1800) + driver.refresh() def send_keys_wait(element, keys): @@ -821,26 +830,30 @@ def CheckPoint(): # a fix, ne marche pas dans 80% des cas, pas appelé aujourd def DailyRoutine(): + + + try: + BingMobileSearch() + except Exception as e: + LogError(f"DalyRoutine - BingMobileSearch - {e}") + print("\n") + CustomSleep(uniform(3, 20)) + MainWindows = login() try: AllCard() except Exception as e: LogError( - f"pas normal sauf si relancer a la main, juste pour les recherches bing (DalyRoutine -> AllCard) \n {e}" + f"DalyRoutine - AllCard - \n {e}" ) try: BingPcSearch() except Exception as e: - LogError(f"il y a eu une erreur dans BingPcSearch, {e}") + LogError(f"DalyRoutine - BingPcSearch - \n {e}") CustomSleep(uniform(3, 20)) - try: - BingMobileSearch() - except Exception as e: - LogError(f"BingMobileSearch - {e}") - print("\n") - CustomSleep(uniform(3, 20)) + try: Fidelite() except: @@ -849,7 +862,7 @@ def DailyRoutine(): try: LogPoint(_mail) except Exception as e: - LogError(f"LogPoint : {e}") + LogError(f"DalyRoutine - LogPoint - \n{e}") def close(): diff --git a/config b/config index bbe6fc3..ebfee02 100644 --- a/config +++ b/config @@ -1,3 +1,7 @@ +from logging import root +from requests import NullHandler + + [PATH] motpath = /your/path/to/words_list.txt @@ -19,3 +23,10 @@ errorlink =https://discord.com/api/webhooks/[put your webhook here] enabled = False url = Null port = 0 + +[DATABASE] +enabled = False +url = Null +port = 0 +user = root +password = password \ No newline at end of file