Automatically pick urls in listbox then load to webbrowser
I found the best solution to make this program.
I have almost made the program which gives urls from google and collect in listbox and sort found as i typed links and copy into richtextbox.
But i need to pick up urls automatically from all pages like 1,2,3,4,5,6,7,8,9 next.
now it does only 1 page.
Here is the part of my code in which i want to make it work and another.
So the question would be how i can make it work automatically using timer,multi threading,backgroundworker for loop, for i = 0 to,do untill or do while i'm new ?
Or maybe you can just help me to fix this code.
This is what i want.

I have the code which is doing automatically but i need your help.
Ok what it gives me ?
First the code works great but the problem with it is not pick urls which i want because it gives me random sites and links.
can you help me fix it ?
Here is the code for far to go:
I can't find how to fix it on internet
I want to make it go with pause 5 seconds and go to next page and so on.
I have almost made the program which gives urls from google and collect in listbox and sort found as i typed links and copy into richtextbox.
But i need to pick up urls automatically from all pages like 1,2,3,4,5,6,7,8,9 next.
now it does only 1 page.
Here is the part of my code in which i want to make it work and another.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("http://www.google.co.zw/search?num=100&hl=en&lr=&biw=1152&bih=683&q=" & TextBox1.Text)
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If (WebBrowser1.ReadyState = WebBrowserReadyState.Complete) Then
For Each ClientControl As HtmlElement In WebBrowser1.Document.Links
If Not ClientControl.GetAttribute("href").Contains("google") And ClientControl.GetAttribute("href").Contains("http") Then
ListBox1.Items.Add(ClientControl.GetAttribute("href"))
End If
Next
End If
End sub
Or maybe you can just help me to fix this code.
This is what i want.

I have the code which is doing automatically but i need your help.
Ok what it gives me ?
First the code works great but the problem with it is not pick urls which i want because it gives me random sites and links.
can you help me fix it ?
Here is the code for far to go:
I can't find how to fix it on internet

I want to make it go with pause 5 seconds and go to next page and so on.
Code:
Public Class Form1
Private Event PageChecked()
Private i As Integer = 1
Private parameter As String
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If (WebBrowser1.ReadyState = WebBrowserReadyState.Complete) Then
For Each ClientControl As HtmlElement In WebBrowser1.Document.Links
Try
If Not ClientControl.GetAttribute("href").Contains("google") And ClientControl.GetAttribute("href").Contains("http") Then
ListBox1.Items.Add(ClientControl.GetAttribute("href"))
End If
Catch ex As Exception
End Try
Next
End If
RaiseEvent PageChecked()
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Dim path As String = DirectCast(e.Argument, String)
WebBrowser1.Navigate("http://www.google****/search?num=100&q=" & path & "&start=" & i * 200)
BackgroundWorker1.ReportProgress(i)
End Sub
Private Sub pageIsChecked() Handles Me.PageChecked
If i < 4 Then
i += 1
BackgroundWorker1.RunWorkerAsync(parameter)
Else
End If
End Sub
