Pyautogui uses the locateOnScreen function to always return None

if you use locateOnScreen according to the example, the None, image is returned as the downloaded image, as follows



:

according to the example, a coordinate should be put back, and if it is not identified, it should be returned to the None. But how could it not be recognized here?

there is another problem. Execute:

im2 = pyautogui.screenshot("my_screenshot.png")

where will the screenshot pictures be stored?

Mar.02,2021

(1) you need to add a time.sleep (2), and then run the code to replace the screen interface with the graphical web page
(2) in two seconds.
(2) it is just a cache and will be released


the picture you are looking for is a screenshot under windows (system tool).
the screenshot image is in the directory of the current script

Menu