Hello.
Here is my code that only shows links with 'a' and 'href' from WebBrowser1's document. How to limit them to these who include 'web_name' in link too? Thanks a lot for help :)
My code:
Here is my code that only shows links with 'a' and 'href' from WebBrowser1's document. How to limit them to these who include 'web_name' in link too? Thanks a lot for help :)
My code:
Code:
Using WebData As New DataTable()
WebData.Columns.AddRange(New DataColumn() _
{ _
New DataColumn("Display", GetType(System.String)), _
New DataColumn("Link", GetType(System.String)) _
} _
)
WebData.TableName = "Links"
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
For Each curElement As HtmlElement In theElementCollection
WebData.Rows.Add(New Object() {
IIf(curElement.InnerText = "", " ", curElement.InnerText),
curElement.GetAttribute("href").ToString})
Next
DataGridView1.DataSource = WebData
End Using