fix som issues in quiz8, where element is not found

This commit is contained in:
piair 2022-06-21 17:36:18 +02:00
parent a3dcf15f7d
commit 776da465aa

24
V4.py
View File

@ -394,12 +394,20 @@ def PlayQuiz8(override=3):
try: try:
driver.execute_script("arguments[0].click();", elem) driver.execute_script("arguments[0].click();", elem)
except Exception as e: except Exception as e:
LogError("playquizz8 - 2 - " + e) LogError(f"playquizz8 - 2 - {e}")
except exceptions.NoSuchElementException as e :
try :
driver.refresh()
CustomSleep(10)
elem = driver.find_element(By.ID, i)
elem.click()
except Exception as e :
LogError(f"playquizz8 - 5 - {e}")
except Exception as e: except Exception as e:
if override: if override:
printf("playquiz8 - 3 -" + e) # may append during printf(f"playquiz8 - 3 - {e}") # may append during
else: else:
LogError("playquizz8 - 3 - " + e) LogError(f"playquizz8 - 3 - {e}")
except Exception as e: except Exception as e:
LogError(f"PlayQuiz8 - 4 - {e} \n ListOfGood : {str(ListeOfGood)}") LogError(f"PlayQuiz8 - 4 - {e} \n ListOfGood : {str(ListeOfGood)}")
@ -485,7 +493,7 @@ def AllCard(): # fonction qui clique sur les cartes
TryPlay(titre) TryPlay(titre)
sleep(1) sleep(1)
reset() reset()
print(f"DailyCard {titre} ok ") printf(f"DailyCard {titre} ok ")
except Exception as e: except Exception as e:
printf(f"Allcard card {titre} error ({e})") printf(f"Allcard card {titre} error ({e})")
except Exception as e: except Exception as e:
@ -493,8 +501,8 @@ def AllCard(): # fonction qui clique sur les cartes
try: try:
dailyCards() dailyCards()
except: except Exception as e:
printf("dans les quetes de la semaine") printf(f"erreur dans les quetes de la semaine {e}")
def weekly_cards(): def weekly_cards():
try: try:
@ -664,9 +672,7 @@ def BingPcSearch(override=randint(35, 40)):
def BingMobileSearch(override=randint(22, 25)): def BingMobileSearch(override=randint(22, 25)):
MobileDriver = ( MobileDriver = "unable to start"
"si il y a ca dans les logs, c'est que Mobiledriver n'a pas demarrer "
)
try: try:
try: try:
MobileDriver = FirefoxDriver(mobile=True) MobileDriver = FirefoxDriver(mobile=True)