wrong parameter in rgpd_popup

This commit is contained in:
piair 2024-02-27 16:21:08 +01:00
parent a88ad8dd47
commit d49742646c
3 changed files with 10 additions and 8 deletions

11
V6.py
View File

@ -2,7 +2,7 @@
from modules.Classes.Config import Config from modules.Classes.Config import Config
from modules.Classes.DiscordLogger import DiscordLogger from modules.Classes.DiscordLogger import DiscordLogger
from modules.Classes.UserCredentials import UserCredentials from modules.Classes.UserCredentials import UserCredentials
from modules.Tools.logger import warning, debug, critical from modules.Tools.logger import warning, critical
from modules.cards import * from modules.cards import *
from modules.config import * from modules.config import *
from modules.db import add_to_database from modules.db import add_to_database
@ -111,11 +111,12 @@ def play_quiz8():
answer_elem = driver.find_element(By.ID, answer_id) answer_elem = driver.find_element(By.ID, answer_id)
answer_elem.click() answer_elem.click()
except ElementClickInterceptedException: except ElementClickInterceptedException:
rgpd_popup(driver) rgpd_popup(config)
correct_answers.append(answer_id) correct_answers.append(answer_id)
except Exception as e: except Exception as e:
log_error(f"{format_error(e)} \n Good answers : {' '.join(correct_answers)}") log_error(f"{format_error(e)} \n Good answers : {' '.join(correct_answers)}")
raise ValueError(format_error(e))
info("Quiz 8 done.") info("Quiz 8 done.")
custom_sleep(3) custom_sleep(3)
@ -297,7 +298,7 @@ def promo():
# Find out which type of action to do # Find out which type of action to do
def try_play(nom="inconnu"): def try_play(nom="inconnu"):
driver = config.WebDriver.driver driver = config.WebDriver.driver
rgpd_popup(driver) rgpd_popup(config)
def play(number): def play(number):
if number in [8, 9]: if number in [8, 9]:
@ -329,7 +330,7 @@ def try_play(nom="inconnu"):
custom_sleep(5) custom_sleep(5)
driver.find_element(By.CSS_SELECTOR, '[onclick="setsrchusr()"]').click() driver.find_element(By.CSS_SELECTOR, '[onclick="setsrchusr()"]').click()
custom_sleep(5) custom_sleep(5)
rgpd_popup(driver) rgpd_popup(config)
custom_sleep(5) custom_sleep(5)
debug("Detected and fixed connection popup") debug("Detected and fixed connection popup")
@ -436,7 +437,7 @@ def bing_pc_search(override=randint(35, 40)):
driver = config.WebDriver.driver driver = config.WebDriver.driver
driver.get(f"https://www.bing.com/search?q={config.wordlist.get_word().replace(' ', '+')}") driver.get(f"https://www.bing.com/search?q={config.wordlist.get_word().replace(' ', '+')}")
custom_sleep(uniform(1, 2)) custom_sleep(uniform(1, 2))
rgpd_popup(driver) rgpd_popup(config)
send_keys_wait( send_keys_wait(
driver.find_element(By.ID, "sb_form_q"), driver.find_element(By.ID, "sb_form_q"),
Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE + Keys.BACKSPACE

View File

@ -6,6 +6,7 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support.wait import WebDriverWait
from modules.Tools.logger import debug
from modules.Tools.tools import * from modules.Tools.tools import *
@ -43,8 +44,8 @@ def rgpd_popup(config) -> None:
for i in ["bnp_btn_accept", "bnp_hfly_cta2", "bnp_hfly_close"]: for i in ["bnp_btn_accept", "bnp_hfly_cta2", "bnp_hfly_close"]:
try: try:
config.WebDriver.driver.find_element(By.ID, i).click() config.WebDriver.driver.find_element(By.ID, i).click()
except: except Exception as err:
pass debug(err)
""" """

View File

@ -1 +1 @@
v6.8.18 v6.8.19