Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created May 18, 2023 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/084aed8f7587816124a2543d3cde3154 to your computer and use it in GitHub Desktop.
Save chuongmep/084aed8f7587816124a2543d3cde3154 to your computer and use it in GitHub Desktop.
import time
import pyautogui
# define the duration of the automation (in seconds)
duration = 6 * 60 * 60 # 3 hours
# define the interval between clicks (in seconds)
interval = 6
# calculate the number of clicks required
num_clicks = duration // interval
# loop through the number of clicks and perform the click operation
for i in range(num_clicks):
# get the current mouse position
#x, y = pyautogui.position()
#print(x, y)
pyautogui.click(1336,968)
time.sleep(interval)
pyautogui.hotkey('ctrl', 'r')
time.sleep(interval)
# fresh web page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment