Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTML element by index
#1
Hello,

Need some help getting an Index number of an HTML element text...then getting subsequent index of that same element text, and Navigating + or - from there to get more text. 

Example:

Find index of first "22" in a page..then get text left or right of that.
Then, find index of next "22" and get text left or right of that.
And so on.


I'm trying to do it by index since search time is so much faster but don't know best(fastest) way to get the index number.

Any ideas?

Thanks
#2
Class Htm supports it, but it can be used only with Internet Explorer. Maybe better use Acc?

Example: in Chrome, in a QM forum thread page, find all text objects containing text "Member", navigate to the above link object, print its name.

Macro Macro3055
Code:
Select All      Help
int w=win("- Google Chrome" "Chrome_WidgetWin_1")
Acc a.Find(w "DOCUMENT" "" "" 0x3000)
ARRAY(Acc) b; int i
a.GetChildObjects(b -1 "STATICTEXT" "*Member" "" 0x1) ;;from: Acc a.Find(w "STATICTEXT" "*Member" "" 0x3001)
for i 0 b.len
,b[i].Navigate("previous3" a)
,out a.Name
#3
Thanks Gintaras for your time and answer.

I am using IE10 and 11 and was able to navigate from an object that remains constant using Htm. Turns out simple +1 did the job.  That only cost me ~15 ms as compared to Acc 250ms.  Huge!

Thx
Rob


Forum Jump:


Users browsing this thread: 1 Guest(s)