Welcome Tour #11

Merged
augustin64 merged 8 commits from explorer-le-programme into master 2024-04-13 11:07:04 +02:00
Showing only changes of commit 19cf77c6bd - Show all commits

17
V6.py
View File

@ -9,7 +9,7 @@ from modules.db import add_to_database
from modules.driver_tools import *
from modules.error import *
from selenium.common.exceptions import ElementClickInterceptedException
import random
# create a webdriver
@ -204,11 +204,18 @@ def all_cards():
return False
info("Popup 'Explorer le programme' reçue")
wait_until_visible(By.CSS_SELECTOR, '[aria-label="Boîte de dialogue Récompenses"]', timeout=10, browser=driver)
wait_until_visible(By.ID, "welcome-tour", timeout=5, browser=driver)
custom_sleep(1.5)
rewards_box = driver.find_element(By.CSS_SELECTOR, '[aria-label="Boîte de dialogue Récompenses"]')
close_button = rewards_box.find_element(By.CSS_SELECTOR, '[aria-label="Fermer"]')
close_button.click()
welcome_tour = driver.find_element(By.ID, "welcome-tour")
interest_button_box = welcome_tour.find_element(By.CLASS_NAME, "interest-buttons")
interests = interest_button_box.find_elements(By.CLASS_NAME, "ng-binding")
debug("Got the following interests: "+str(interests))
random.choice(interests).click() # Choose interest
custom_sleep(1.5)
claim_button = welcome_tour.find_element(By.ID, "claim-button")
claim_button.click() # submit
custom_sleep(1.5)
return True