Results of locating small objects with pyautogui change depending on browser's window size

30 Views Asked by At

I'm in process of automating browser application and I need to locate first some objects to do proper calculations and continue, they're percent sign and plus icon in circle along with minus in circle from Google Icons, however it doesn't really matter because it can affect everything. I noticed that depending on browser's windows size, for example when I change its width to see PyCharm windows as well and GUI of my program on my monitor, these elements look different. Please take a look for example at percent sign in magnification:
Percent comparison
It's the same sign but one was taken for example when browser's window was maximized and then width changed a little bit. Also percent sign together with any other characters can be different if there are more of them on the same screen (we're omitting resizing matter) although they represent same character. In result it makes impossible to set pyautogui.locateAllOnScreen settings combinations like confidence and grayscale to make it always work. Is it common issue and is there any way to correct it by maybe changing browser settings or something in python's code? I assume if object we want to locate is larger then pyautogui doesn't have so much doubts. My only idea is to make more png screenshots for the same objects I want to locate and check for all of them.

0

There are 0 best solutions below