import pyautogui as pg
while True:
window = pg.locateOnScreen("erteilen.png", minSearchTime=3, confidence=0.9)
try:
print(window)
pg.click(x=window.left+int(window.width/2), y=window.top+int(window.height/2), clicks=3)
except Exception as e:
break
It will click on the found window, then the same window opens again, but the script won't locate it again.
When I click in the command window, it seems like pyautogui refreshes it's screen and then finds the window.
Hello everyone,
I have this code:
It will click on the found window, then the same window opens again, but the script won't locate it again. When I click in the command window, it seems like pyautogui refreshes it's screen and then finds the window.
Can someone help me? Thanks in advance!
Michael