InnerHTML without Id help
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
You could check to see if the li tag has any attributes that you are looking for. E.g. you could check the class:
Code: Select all
You could also get the element of the parent node 'link-bar', then just run GetElementsByTagName("li") from this node, the first sub-element will be the right one. For i As Integer = 0 To elements.Count - 1
If elements(i).GetAttribute("className") = "credits" Then
Label1.Text = elements(i).InnerText
Exit For
End If
Next
'Note: className is implemented in IE.
mandai wrote:You could check to see if the li tag has any attributes that you are looking for. E.g. you could check the class:Code: Select allYou could also get the element of the parent node 'link-bar', then just run GetElementsByTagName("li") from this node, the first sub-element will be the right one.For i As Integer = 0 To elements.Count - 1 If elements(i).GetAttribute("className") = "credits" Then Label1.Text = elements(i).InnerText Exit For End If Next 'Note: className is implemented in IE.
elements isn't declared.
also, what you mean by classname implemented in IE, i use chrome.
elements is declared in the previous sample.
The className attribute is used to check the class, this is only because in a webbrowser control/IE calling GetAttribute("class") will always return an empty string.
The className attribute is used to check the class, this is only because in a webbrowser control/IE calling GetAttribute("class") will always return an empty string.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023