python使用pyautogui库模拟鼠标操作实例
本文最后更新于:2024年12月14日 下午
python使用pyautogui库模拟鼠标操作实例
import pyautogui
import time
num_of_executions = int(input("请输入需要删除的页数:"))
time.sleep(5)
xy=pyautogui.position()
num_of_iterations = 0
nnum_of_iterations=0
while nnum_of_iterations < num_of_executions:
num_of_iterations += 1
pyautogui.moveTo(xy)
time.sleep(1)
pyautogui.moveRel(0, 125)
pyautogui.mouseDown()
pyautogui.mouseUp()
time.sleep(1)
pyautogui.moveTo(1040, 732)
pyautogui.mouseDown()
pyautogui.mouseUp()
time.sleep(1)
if num_of_iterations == 20:
pyautogui.moveTo(860, 690)
pyautogui.mouseDown()
pyautogui.mouseUp()
time.sleep(3)
nnum_of_iterations+=1
# 重置循环计数器
num_of_iterations = 0
微信支付
支付宝支付
“请博主喝咖啡☕️”