import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import NoSuchElementException
new_messages = [message for message in messages if message notin checked_messages] for message in new_messages: checked_messages.add(message)
hack_messages = [message for message in new_messages if"hack["in message.find_element(By.TAG_NAME, "span").text.lower()] for message in hack_messages: monitor_and_click_hack(message)