问题
I'm trying to click into a program window using pyautogui.
When clicking in the program window, on a button I wish to press, a loading icon appears next to the mouse cursor as if it is thinking, and it never actually clicks. It does, however, move to the cursor location that I provide.
Here's the code
import pyautogui
pyautogui.doubleClick(x=300, y=300)
I opened Excel to see if it will click into that, and it does, but only if I run the code as:
import pyautogui
pyautogui.doubleClick(x=300, y=300)
pyautogui.doubleClick(x=300, y=300)
What the heck do I do?
回答1:
If the application in running as administrator and pyautogui script is not running as administrators, then control will not work. pyautogui script should also run as administrator to control it
回答2:
Try giving the interval argument
pyautogui.doubleClick(x=300, y=300, interval=0.25)
来源:https://stackoverflow.com/questions/40983604/having-trouble-clicking-in-program-pyautogui