Hello
@Descolada
I want to retrieve some data from a webpage.
The data is student's ID and there are many of them in one webpage.
I checked with UIA viewer and founded that they have same Type and different value.
I can get one ID by using ElementFromPath.
But I cannot get every ID at once.
I tried to use Loop to do it, it worked but I thought maybe there is a better solution?
The elements I need to retrieve has similar path.
For example, the path is ("2,1,1,2,2,1,1,1,1,1,1,1,2,1,a,7") a = 1 to 5
Can I get the elements from path:
("2,1,1,2,2,1,1,1,1,1,1,1,2,1,1,7")
("2,1,1,2,2,1,1,1,1,1,1,1,2,1,2,7")
("2,1,1,2,2,1,1,1,1,1,1,1,2,1,3,7")
("2,1,1,2,2,1,1,1,1,1,1,1,2,1,4,7")
("2,1,1,2,2,1,1,1,1,1,1,1,2,1,5,7")
My code right now:
Code: Select all
WinWaitActive "ahk_exe msedge.exe"
cUIA := UIA_Browser()
!1::
{
a := 1
npEl := cUIA.ElementFromHandle("ahk_exe msedge.exe")
link := Array()
Loop 5
{
msedgeEl := npEl.ElementFromPath("2,1,1,2,2,1,1,1,1,1,1,1,2,1," . a . ",7").Value
link.Push msedgeEl
a := a+1
}
MsgBox "Done"
return
}
How to save those elements to an array with a quick and simple way?
Or I have to use Loop?
Any tips or suggestions will be helpful, thanks.