May-22-2021, 01:58 AM
Hi guys,
I am wanting help with either turning this below code into either a For statement so I can ultimately create a loop for hourly or scheduling the below code to schedule it every hour:
I am wanting help with either turning this below code into either a For statement so I can ultimately create a loop for hourly or scheduling the below code to schedule it every hour:
from selenium import webdriver from selenium import webdriver from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager import time import schedule from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By driver = webdriver.Chrome(ChromeDriverManager().install()) driver.get("https://www.google.com/search?q=bing&source=lnms&tbm=nws&sa=X&ved=2ahUKEwjfy6yg0dnwAhWFvZ4KHV07BuQQ_AUoA3oECAEQBQ&biw=1036&bih=812&dpr=1.5") button = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[7]/div/div[3]/div/div[1]/div/div[1]/div/div[4]"))) button.click()