Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27005

VS 2010 Get elements with 'web_name' in adress.

$
0
0
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:
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


Viewing all articles
Browse latest Browse all 27005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>