How to find the image in a webpage?
Posted: 12 Jun 2021, 00:20
Hi,
I want to find the image in a webpage that might be anywhere in a certain area of the window.
The image is always found if its position differs on a Y-axis.
But it's never found when its position differs on a X-axis.
How to find the image that has various positions on a X-axis?
I've tried the following script that's supposed to increment the X-axis position of the image search by 10 (810, 820, 830, etc.), but it doesn't work.
Please let me know where my mistake is.[Mod edit: [code][/code] tags added.]
I want to find the image in a webpage that might be anywhere in a certain area of the window.
The image is always found if its position differs on a Y-axis.
But it's never found when its position differs on a X-axis.
How to find the image that has various positions on a X-axis?
I've tried the following script that's supposed to increment the X-axis position of the image search by 10 (810, 820, 830, etc.), but it doesn't work.
Please let me know where my mistake is.
Code: Select all
StartX := 800
Loop
{
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, %StartX%, 139, 1930, 1090, C:\Users\KILLERWHALE\AppData\Roaming\MacroCreator\Screenshots\Screen_20210612082420.png
CenterImgSrchCoords("C:\Users\KILLERWHALE\AppData\Roaming\MacroCreator\Screenshots\Screen_20210612082420.png", FoundX, FoundY)
Sleep, 111
If (ErrorLevel)
{
StartX += 10
Sleep, 300
}
Else
{
Break
}
}
MsgBox, 0, , Found the image!