top habitué au JS

This commit is contained in:
piair 2024-04-26 14:00:33 +02:00
parent 22ea727c47
commit 12eba5cde7
1 changed files with 4 additions and 3 deletions

7
V6.py
View File

@ -4,7 +4,7 @@ import random
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 critical from modules.Tools.logger import critical, warning
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
@ -267,7 +267,8 @@ def all_cards():
try: try:
activity = findall("data-bi-id=\"([^\"]+)\"", card_list[i].get_attribute("innerHTML"))[0] activity = findall("data-bi-id=\"([^\"]+)\"", card_list[i].get_attribute("innerHTML"))[0]
except: except Exception as e:
warning("Can't find activity." + str(e))
activity = "" activity = ""
custom_sleep(1.5) custom_sleep(1.5)
@ -349,7 +350,7 @@ def explore_on_bing(activity: str, config: Config):
driver = config.WebDriver.driver driver = config.WebDriver.driver
def search_bing(txt): def search_bing(txt):
search_elm = driver.get_element(By.ID, "sb_form_q") search_elm = driver.find_element(By.ID, "sb_form_q")
send_keys_wait(search_elm, txt) send_keys_wait(search_elm, txt)
send_keys_wait(search_elm, Keys.ENTER) send_keys_wait(search_elm, Keys.ENTER)