fix de la popup "explorer le programme"
peu satisfaisant, consiste juste à fermer la popup à chaque fois qu'elle apparaît sans s'en débarrasser définitivement
This commit is contained in:
parent
c5e9fb1267
commit
68b5de32d6
12
V6.py
12
V6.py
|
@ -9,6 +9,8 @@ from modules.db import add_to_database
|
||||||
from modules.driver_tools import *
|
from modules.driver_tools import *
|
||||||
from modules.error import *
|
from modules.error import *
|
||||||
|
|
||||||
|
from selenium.common.exceptions import ElementClickInterceptedException
|
||||||
|
|
||||||
|
|
||||||
# create a webdriver
|
# create a webdriver
|
||||||
def create_driver(mobile=False):
|
def create_driver(mobile=False):
|
||||||
|
@ -243,7 +245,15 @@ def all_cards():
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
driver.execute_script("arguments[0].scrollIntoView();", card_list[i])
|
||||||
custom_sleep(1.5)
|
custom_sleep(1.5)
|
||||||
card_list[i].click()
|
try:
|
||||||
|
card_list[i].click()
|
||||||
|
except ElementClickInterceptedException: # Popup "Explorer le programme"
|
||||||
|
debug("Popup 'Explorer le programme' reçue")
|
||||||
|
rewards_box = driver.find_element_by_css_selector('[aria-label="Boîte de dialogue Récompenses"]')
|
||||||
|
close_button = driver.find_element_by_css_selector('[aria-label="Fermer"]')
|
||||||
|
close_button.click()
|
||||||
|
custom_sleep(1.5)
|
||||||
|
card_list[i].click()
|
||||||
|
|
||||||
if len(driver.window_handles) > 1:
|
if len(driver.window_handles) > 1:
|
||||||
driver.switch_to.window(driver.window_handles[1])
|
driver.switch_to.window(driver.window_handles[1])
|
||||||
|
|
Loading…
Reference in New Issue