Jak się dostać przez 9 divów do class w Webbrowser

0

W jaki sposób się dostać do zaznaczonej "class" przez te 9 divów co jest przed nim?

        Dim theElementCollection As HtmlElementCollection
        Dim curElement As HtmlElementCollection
        theElementCollection = WebBrowser1.Document.GetElementsByTagName("div")
        curElement = theElementCollection.GetElementsByName("div")

tak trzeba powtarzac 9 razy ?

123.png

0

Mam wrażenie ze komuś tu płacą za utrudnianie sobie życia... a od czego są metody pobierające kolekcje elementów i pętle?

        Dim widgetDivElement As HtmlElement = WebBrowser1.Document.GetElementById("widget_bounds")
        If widgetDivElement <> Nothing Then
            Dim spanElementsCollection As HtmlElementCollection = widgetDivElement.GetElementsByTagName("span")
            For Each spanElement As HtmlElement In spanElementsCollection
                If String.Compare(spanElement.GetAttribute("className"), "Oga") Then
                    'mamy teb span
                    MsgBox("Ok :)")
                    Exit For
                End If
            Next
        End If

1 użytkowników online, w tym zalogowanych: 0, gości: 1