Я пытаюсь автоматизировать установку программного обеспечения с помощью python и pyautogui, но pyautogui не щелкает, не нажимает, просто найдите местоположение:
import pyautogui
import time
import pyperclip
for window in pyautogui.getWindows():
pyautogui.getWindow(window).minimize()
##Open the directory where we can find the .exe
pyautogui.hotkey("win","r")
pyautogui.press("\\")
pyautogui.press("\\")
pyperclip.copy("ts1/publico/Meus Documentos/Equipes Qualidade/Automação/Aplicativos/Folha/Sefip 8.4")
pyautogui.hotkey("ctrl","v")
pyautogui.press("enter")
##Take the .exe position and click on it.
executavel = None
while executavel is None:
executavel = pyautogui.locateOnScreen("executavel.png", grayscale=False)
executalvelX, executavelY = pyautogui.center(executavel)
pyautogui.click(executalvelX, executavelY, clicks=2)
##The program opens
##Find the button "YES", and click on it(The Script find the button, but pyautogui.click(), pyautogui.moveTo(), pyautogui.press() don't work!)
botaoSim = None
while botaoSim is None:
botaoSim = pyautogui.locateOnScreen("botaosim.png", grayscale=False)
botaoSimX, botaoSimY = pyautogui.center(botaoSim)
for _ in range(4):
next1 = None
while next1 is None:
next1 = pyautogui.locateOnScreen("next.png", grayscale=False)
next1X, next1Y = pyautogui.center(next1)
pyautogui.click(next1X, next1Y)
Следуйте кнопке «ДА»:
Почему функции не работают?