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

VS 2010 Looping a webbrowser

$
0
0
Hey Guys,

What i'm trying to do here is loop a webbrowser control to go to the next page of a site:

Code:

        WebBrowser.Navigate("http://site.com/?start=200&flimit=200")

        '// CHECK BROWSER STATE
        If WebBrowser.ReadyState <> WebBrowserReadyState.Complete Then
            Dim html As String = WebBrowser.DocumentText
            Dim pattern As String = "(?<=<td class=""field_domain""><a href="".+"" target=""_blank"" rel=""nofollow"" title="".+"">).+(?=</a></td>)"
            Dim rx As New Regex(pattern, RegexOptions.IgnoreCase Or RegexOptions.Compiled)

            '// LOOP THE MATCHES OUT
            Dim mc As MatchCollection = Regex.Matches(html, pattern)
            For Each m In mc
                listviewMain.Items.Add(m.ToString)
            Next
        Else
            statusStrip.Text = "Loading..."
        End If

After this page has been loaded and the data extracted we want to go to:

Code:

http://site.com/?start=400&flimit=200
then

Code:

http://site.com/?start=600&flimit=200
etc
etc

In increments of 200, i can't think of the bets way to loop the web browser.

any help would be great guys!

cheers

Graham

Viewing all articles
Browse latest Browse all 27046

Trending Articles



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