For example, the following html is available:
To get the values (d, e, f) in span in the div of "class2" in order
What should I do?
<div class="class1">
<span>a</span>
<span>b</span>
<span>c</span>
</div>
<div class="class2">
<span>d</span>
<span>e>/span>
<span>f</span>
</div>
I came up with an idea and tried it as shown in the code below.
If you can find the div object in class2
I understand that you will do the same for that object.
I got the values (a,b,c) and it didn't work.
For Eachobj1InobjIE.document.all.tags("div")
Ifobj1.classname="class2" Then
For Eachobj2Inobj1. document.all.tags("span")
debug.print "span" & obj2.inertext & " - > " & obj2.inertext
Next
End If
Next
Thank you for your cooperation.
vba
IE8 and later use the querySelectorAll
method.
span
in "class2" divdiv.class2span
when expressed in the CSS selector.
For Each span InobjIE. document.querySelectorAll("div.class2span")
debug.print "span" & span.inertext
Next
Is that so?
© 2024 OneMinuteCode. All rights reserved.