Hello!
I'm developing an application for myself and I'm having a problem can anyone help me?
I have a module
Code:
Module Extensions
<Runtime.CompilerServices.Extension()> _
Public Function GetElementsByClassName(ByVal Source As HtmlDocument, ByVal ClassName As String) As HtmlElement()
Dim output As New List(Of HtmlElement)
For i As Integer = 0 To Source.All.Count - 1
Try
If (Source.All(i).GetAttribute("className") = ClassName) Then
output.Add(Source.All(i))
End If
Catch ex As Exception
End Try
Next
Return output.ToArray()
End Function
End Module
Anyway, the problem is that I need to get more than one class in a single row.
I have the following code plus is returning error
Code:
Dim app As HtmlElement = WebBrowser1.Document.GetElementsByClassName("pid-1-high" & "pid-1-ask & pid-1-ask2")(0)
I want to add this class automatically in a listview
Code:
Dim z As ListViewItem
z = New ListViewItem(app.GetAttribute("InnerText"))
Can someone help me? Thank you