Can not find image using pyautogui

Viewed 168

Using mac


import time
time.sleep(10.4)
a=pyautogui.locateOnScreen('/Users/husaynjaffer/Dropbox/Mac/Desktop/Screen Shot 2021-07-17 at 1.22.32 AM.png', grayscale=False, confidence =.5)
print(a)

returns None

expected: "location of the file on screen"

any ideas to debug or fix anyone with the same issue

1 Answers

It means that the image was not located on the screen, check out the code. To debug it you have to step through the function and check where it goes wrong.

Related