965-Python-Learning-Repo/temp.py
2023-06-03 11:47:20 +08:00

14 lines
285 B
Python
Executable File

import pyautogui
# 获取屏幕分辨率
screen_width, screen_height = pyautogui.size()
# 获取按钮的坐标
button_x, button_y = pyautogui.locateCenterOnScreen('button.png')
# 移动鼠标到按钮的位置
pyautogui.moveTo(button_x, button_y)
# 单击按钮
pyautogui.click()