lundi 28 mars 2016

How to get the value of a div in AutoIt?

In this case I want to get a specific value of the last div from this list:

<div id="past">
    <div class="ball ball-8" data-rollid="242539">11</div>
    <div class="ball ball-8" data-rollid="242540">11</div>
    <div class="ball ball-1" data-rollid="242541">3</div>
    <div class="ball ball-8" data-rollid="242542">11</div>
    <div class="ball ball-1" data-rollid="242543">5</div>
    <div class="ball ball-1" data-rollid="242544">2</div>
    <div class="ball ball-1" data-rollid="242545">7</div>
    <div class="ball ball-8" data-rollid="242546">14</div>
    <div class="ball ball-1" data-rollid="242547">4</div>
    <div class="ball ball-1" data-rollid="242548">3</div>
</div>

I just want to get the outerText from the last entry of this block. In this case it would be 3 with rollid="242548". How could I get this value? I tried:

$lasts = _IETagNameGetCollection($create, "div")
    For $last In $lasts
    If String($last.id) = "past"  And String($last.innerText) = "242548" Then
        $get = _IEGe
        MsgBox(0,"","")
    $outer = $last.outerText
    GUICtrlSetData( $labellast, $outer)
    EndIf
    Next

but it doesn't work. Any suggestions?




Aucun commentaire:

Enregistrer un commentaire