How to search a image/text in the webpage if the image is appeared more than once?
ImageSearch can only find one, how can I find the image/text all
How to search a image/text in the webpage if the image is appeared more than once
Re: How to search a image/text in the webpage if the image is appeared more than once
Thanks for help!trust_me wrote:Take a look at Oldman's code here:
https://autohotkey.com/board/topic/1177 ... ntry676281
I've tried the code,but found that the coordinate was always the same one.
SearchImage(ByRef _ix, ByRef _iy, ByRef _x1, ByRef _y1, _x2, _y2, ByRef _image, _options="")
{
static lx1= , liw, lih
if _options
_options .= A_Space
if (lx1 = "")
{
lEnum := GetDetailsOf(_image, [27, 28])
liw := SubStr(lEnum[27], 1, InStr(lEnum[27], "pixels")-2)
lih := SubStr(lEnum[28], 1, InStr(lEnum[28], "pixels")-2)
lx1 := _x1
}
else if (_x1 > lx1)
{
ImageSearch, _ix, _iy, _x1, _y1, _x2, _y1 + lih - 1, % _options _image
if ErrorLevel
{
_x1 := lx1
if (++_y1 > _y2 - lih)
{
lx1=
return false
}
}
else
{
_y1 := _iy
if ((_x1 := _ix + liw) > _x2 - liw)
{
_x1 := lx1
if (++_y1 > _y2 - lih)
_y1 := y2
}
return true
}
}
ImageSearch, _ix, _iy, _x1, _y1, _x2, _y2, % _options _image
if ErrorLevel
{
lx1=
return false
}
_y1 := _iy
if ((_x1 := _ix + liw) > _x2 - liw)
{
_x1 := lx1
if (++_y1 > _y2 - lih)
_y1 := y2
}
return true
}
I can't understand the code that marked use red color.
Re: How to search a image/text in the webpage if the image is appeared more than once
On win10 the width / height is returned as line 177 and 179 and not 27 ,28 as on winXP by the GetDetailsOff() function.The code extracts the value from the string.
Oldman later provided a more streamlined function ( but with winXp values)
https://autohotkey.com/board/topic/1203 ... -function/
I tested it on win10 and attached the test images and updated code.
- Attachments
-
- red.png (114 Bytes) Viewed 682 times
-
- test.png (517 Bytes) Viewed 682 times
-
- old man search.ahk
- (6.74 KiB) Downloaded 20 times
Who is online
Users browsing this forum: iamasink, jollyjoe, Noitalommi_2, RareUserGerman, Rohwedder and 311 guests