remove trailing spaces + added some comments + dealed with error with some popus + some little things
This commit is contained in:
parent
5f554cc9b2
commit
df0ea09662
20
V4.py
20
V4.py
|
@ -274,6 +274,9 @@ def Close(fenetre, SwitchTo=0):
|
|||
driver.switch_to.window(driver.window_handles[SwitchTo])
|
||||
|
||||
|
||||
"""
|
||||
Deal with RGPD popup as well as some random popup like 'are you satisfied' one
|
||||
"""
|
||||
def RGPD():
|
||||
try:
|
||||
driver.find_element(By.ID, "bnp_btn_accept").click()
|
||||
|
@ -283,12 +286,19 @@ def RGPD():
|
|||
driver.find_element(By.ID, "bnp_hfly_cta2").click()
|
||||
except:
|
||||
pass
|
||||
try :
|
||||
driver.find_element(By.id, "bnp_hfly_close").click() #are you satisfied popup
|
||||
except :
|
||||
pass
|
||||
|
||||
|
||||
def PlayQuiz2(override=None):
|
||||
|
||||
"""
|
||||
PlayQuiz2([int : override]) make the quizz with 2 choice each time. They usually have 10 questions.
|
||||
override is the number of question, by default, it's 10. Can be usefull in some case, where the programm crashes before finishing the quizz
|
||||
"""
|
||||
def PlayQuiz2(override=10):
|
||||
printf("debut de PlayQuiz2")
|
||||
if not override:
|
||||
override = 10
|
||||
for j in range(override):
|
||||
try:
|
||||
RGPD()
|
||||
|
@ -450,7 +460,7 @@ def AllCard(): # fonction qui clique sur les cartes
|
|||
except:
|
||||
printf("erreur ici")
|
||||
|
||||
def weekly_cards() :
|
||||
def weekly_cards():
|
||||
try:
|
||||
driver.find_element(
|
||||
By.XPATH, "/html/body/div/div/div[3]/div[2]/div[2]/div[2]/div[1]"
|
||||
|
@ -484,7 +494,7 @@ def AllCard(): # fonction qui clique sur les cartes
|
|||
] # verifie si on a toujours des cartes
|
||||
except:
|
||||
break
|
||||
for i in range(3) :
|
||||
for i in range(3):
|
||||
try :
|
||||
weekly_cards()
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue