I tried the operation with pyautogui on a PC connected with a remote desktop and tried to execute the following code, but when I clicked the icon on the remote desktop, it says "Target not found" I get an error and won't click.
Is there a way to control remote desktop with python code?
Remote desktop icon on desktop
Double click on this
Remote desktop password entry screen
After entering the password in this "Password" field, click the "OK" button below to connect to Remote Desktop
The python source code and each png are in the same folder
import pyautogui as gui try: 'Double-click the remote desktop connection icon on your desktop x, y = gui.locateCenterOnScreen ("./ connectremotedesktop.png") gui.click (x, y, clicks = 2) # p = gui.position () # gui.click (p, clicks = 2) 'Enter password for connection gui.sleep (1) gui.typewrite ("password") 'Click the OK button x, y = gui.locateCenterOnScreen ("./ btnOK.png") gui.click (x, y) gui.sleep (5) 'This doesn't work x, y = gui.locateCenterOnScreen ("./ IconOnRemotedesktop.png") gui.click (x, y, clicks = 2) except Exception as ex: print ("Target not found.") print (ex)
The target was not found. cannot unpack non-iterable NoneType object
Answer # 1
The wallpaper color on the remote desktop is probably the same as the background color of connectremotedesktop.png.
However, because the background color of IconOnRemoteDesktop.png is different, the target was not found.
Capture the Firefox icon with the same background color as connectremotedesktop.png and make it IconOnRemoteDesktop.png.
That should succeed.
- how to make python, desktop app
- i want to click and number a few images like a switch in python
- python - how to enter confidential information of desktop applications that are supposed to be distributed
- python 3x - i want to save the csv file saved by jupyter lab on the desktop
- python - [selenium] click the radio button
- python - [selenium] i want to click the dropdown, but an error is returned
- python - i want to delete a remote repository
- python - cannot import pyautogui
- python - i got an import error even though i did pip install
- python - it takes too much time to do with big data with many for
- python - psycopg2 cannot be read by pycharm
- python - i got an error in opencv
- only part of the data is recognized when learning python
- python - i want to convert the characters obtained from the txt file to numbers
- python - discord teaming bot doesn't work properly
- i have a question about runtime errors and exception handling in python
- python - all commands cannot be used with discord bot