I'm learning Selenium, and I've tried to make an automatic clicker for this game https://orteil.dashnet.org/cookieclicker/ .
I've made a Action Chain to click on the big cookie on the left side and put this into the loop. But it click only once.
I tried, this loop also on https://clickspeedtest.com/ page, with same reasoult.
I also tried to add actions.pause(1)
, and time.sleep(1)
inside the loop.
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
PATH = r"C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://orteil.dashnet.org/cookieclicker/")
driver.implicitly_wait(5)
bigCookie = driver.find_element_by_id("bigCookie")
actions = ActionChains(driver)
actions.click(bigCookie)
for i in range(10):
actions.perform()