Jump to content

id and class


gimx
 Share

Recommended Posts

Hello,

I get div and tbody in webpage.

For tbody, i want to get only the tbody with class="blabla" and that work :

For $oTbody In $oTbodyBlabla
If String($oTbody.className) = "blabla" Then
(code)
EndIf

Now, i want to get div by the id but that don't work.

I use this code, what's wrong plz ?

For $oDiv In $oDivIdid
If String($oDiv.id) = "ididid" Then
(code)
EndIf

Thx :D

Edited by gimx
Link to comment
Share on other sites

@gimx...

It worked for me...

$oDivIdid = _IETagNameGetCollection ($oIE, "DIV")
For $oDiv In $oDivIdid

MsgBox(4096,"",String($oDiv.id) )
Next

I would use the following example from the help file to see if there are any div in the webpage.

$oElements = _IETagNameAllGetCollection ($oIE)
For $oElement In $oElements
    MsgBox(0, "Element Info", "Tagname: " & $oElement.tagname & @CR & "innerText: " & $oElement.innerText)
Next
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...