Welcome Tour #11
10
V6.py
10
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,6 +245,14 @@ 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)
|
||||||
|
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()
|
card_list[i].click()
|
||||||
|
|
||||||
if len(driver.window_handles) > 1:
|
if len(driver.window_handles) > 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user