looking to go backwards through this loop and cant work out the format.
For Each subele As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
thanks in advance
looking to go backwards through this loop and cant work out the format.
For Each subele As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
thanks in advance
You can't. A For Each
loop direction can't be controlled.
What you can do is replace it with a for loop:
'' Note: Option infer should be set to ON for this line!
Dim elements = WebBrowser1.Document.GetElementsByTagName("div")
For i as Integer = elements.Length To 0 Step -1
Dim subele As HtmlElement = elements(i)
Next
If you only need the last element returned from GetElementsByTagName
you can simply do this:
Dim elements = WebBrowser1.Document.GetElementsByTagName("div")
Dim subele As HtmlElement = elements(elements.Length-1) ' or perhaps Count, I'm not sure if this method returns an array, a list, or simply an IEnumerable...