python-imagesearch icon indicating copy to clipboard operation
python-imagesearch copied to clipboard

Sometimes need delay after pyautogui mouse click before calling imagesearch

Open wbrells opened this issue 5 years ago • 1 comments

I'm using 'pyautogui' along with various 'imagesearch' routines (usually imagesearch_loop) to automate the creating of Google Photo albums. I've found that it is sometimes necessary to add a time delay (e.g. time.sleep(2)) AFTER calling pyautogui to click on a button that brings up a sub-menu of some type and BEFORE using imagesearch_loop to look for a item on the new menu. If I don't add this delay, the sub-menu doesn't come up and, of course, imagesearch_loop keeps looking forever! This behavior doesn't seem to occur every time I click on a menu item, but it does seem to happen consistently when working with certain menus...

I've had to use a trial-and-error approach to determine where time delays are required, and I probably have a lot more delays than necessary in my program. I was hoping to always just click on a menu item and then immediately call imageseach_loop to wait for the new sub-menu to pop up. Unfortunately, that approach doesn't always work!

Does anyone know why imagesearch appears to "block" certain clicks from pyautogui?

Thanks, Wayne

wbrells avatar Jul 14 '20 13:07 wbrells

pyautogui is very slow...

huruka avatar Feb 08 '21 01:02 huruka