Jump to content

Pepsi Zero Sugar Rookie Of The Week: Week 2 Voting


Recommended Posts

33 minutes ago, Jet_Engine1 said:

a_farm_that_grows_robots_by_condor4459_di6uv3v.thumb.jpg.61693a606855d060f7669c4bdade0e51.jpg

import time
import random
from selenium import webdriver
from selenium.webdriver.common.by import By
from threading import Thread

def automate_clicks():
    # Initialize the WebDriver (modify as needed for your browser)
    driver = webdriver.Chrome()  # Replace with the path to your chromedriver if necessary

    try:

        while True:

            # Navigate to your website
             driver.get('https://www.nfl.com/voting/rookies/')


            # Random delay between 10 seconds and 2 minutes
            delay = random.uniform(10, 120)
            time.sleep(delay)

            # Click on the first element using data attribute
            element1 = driver.find_element(By.CSS_SELECTOR, '[data-choice-id="5"]')
            element1.click()

            # Another random delay
            delay = random.uniform(10, 120)
            time.sleep(delay)

            # Click on the "Vote Now" button using its data-test attribute
            vote_button = driver.find_element(By.CSS_SELECTOR, 'button[data-test="choose-btn"]')
            vote_button.click()

    except Exception as e:
        print(f"An error occurred: {e}")
    finally:
        driver.quit()

# Run the automation in a separate thread to keep it running in the background
thread = Thread(target=automate_clicks)
thread.start()
 

  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...