对不起,我不支持对 GUI 进行操作。您可以尝试使用 PyAutoGUI 库来实现该功能。
代码示例:
import pyautogui # 导入 PyAutoGUI 库
import time # 导入 time 库
# 持续查找"关闭"字符是否出现在程序窗口中
while True:
if "关闭" in pyautogui.getWindowText():
# 当"关闭"字符出现时,找到关闭按钮的坐标
close_button_location = pyautogui.locateOnScreen("close_button.png"