James
asked on
Get more than one getElementsByTagName in loop?
How do you obtain more than one TAG when recursing a document? What I am asking is how whould I extract a TABLE following the "A" link below? In other words, once I find a href link....move next extract the table following it so I can print both the link AND the first TABLE that follows after it!
Dim alink As HTMLLinkElement
Dim table As HTMLLinkElement
For Each alink In WebBrowser1.Document.getEl ementsByTa gName("A")
' just need to figure out how to get the table below the LINK!
debug.print alink
Next
Dim alink As HTMLLinkElement
Dim table As HTMLLinkElement
For Each alink In WebBrowser1.Document.getEl
' just need to figure out how to get the table below the LINK!
debug.print alink
Next
ASKER
That sample wasn't any help.
How can I just check for a match in a loop to the elements? Like this:
Dim alink As HTMLLinkElement
Dim bfound as Boolean
For Each alink In WebBrowser1.ALL
'Check if alink is a "A" tag then grab its text
' set a boolean to true if "A" has been found then
'next loop grab the "TABLE" text and set boolean = false and continue looking
'for the next "A" link
Next
How difficult is it to make this work?
How can I just check for a match in a loop to the elements? Like this:
Dim alink As HTMLLinkElement
Dim bfound as Boolean
For Each alink In WebBrowser1.ALL
'Check if alink is a "A" tag then grab its text
' set a boolean to true if "A" has been found then
'next loop grab the "TABLE" text and set boolean = false and continue looking
'for the next "A" link
Next
How difficult is it to make this work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.freevbcode.com/ShowCode.Asp?ID=2442