Why PyAutoGui LocateOnScreen() only Returns None

前端 未结 11 1941
悲&欢浪女
悲&欢浪女 2020-12-15 10:39

Here\'s the code that I\'m trying to run:

import pyautogui
r=pyautogui.locateOnScreen(\'C:\\Users\\David\\Desktop\\index.png\',grayscale=False)
print r
         


        
11条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 11:33

    The first answer was the answer for me.

    After doing pip install opencv_python and then modifying my search like below things worked:

    button7location = pyautogui.locateOnScreen('1606271188298.png',grayscale=True, confidence=.5)
    

    Thanks!

提交回复
热议问题