how to make it work automatically ? 07-21-2011, 03:56 PM
#1
Hello.
Do you know how to work backgroundworker with this code?
The request would be as I pulled out of google with a background worker and if so it is possible to collect links from google pagination.
Not in label or how I'm new for that.
I just want To make go to next page like 1,2,3,4,5,6,7,8,9 and so on clicking button and make it go itself and pick up links through all pages with background worker or timer or how to make it work automatically as i said i'm new.
Like google has pagination.
It only goes through one page and stop on first number and do not move
far.
Thank you.
If do not understand what i mean to say so here is the example of that i want to get.
Do you know how to work backgroundworker with this code?
The request would be as I pulled out of google with a background worker and if so it is possible to collect links from google pagination.
Not in label or how I'm new for that.
I just want To make go to next page like 1,2,3,4,5,6,7,8,9 and so on clicking button and make it go itself and pick up links through all pages with background worker or timer or how to make it work automatically as i said i'm new.
Like google has pagination.
It only goes through one page and stop on first number and do not move
far.
Thank you.
Code:
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 I HtmlElement In WebBrowser1.Document.Links
IF NOT ClientControl.GetAttribute ("href"). Contains (Google) And ClientControl.GetAttribute ("href"). Contains ("http") and ClientControl.GetAttribute ("href"). Contains ("http") Then
ListBox1.Items.Add (ClientControl.GetAttribute ('href'))
end If
Next
end If
end Sub
Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate (http://www.google.lt/search?num=100&q = "& ComboBox1.Text)
BackgroundWorker1.RunWorkerAsync ()
end Sub
Private Sub BackgroundWorker1_DoWork (ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
For i = 0 to 100
Threading.Thread.Sleep (200)
BackgroundWorker1.ReportProgress (i)
Next
end Sub
Private Sub BackgroundWorker1_ProgressChanged (ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
Label1.Text = e.ProgressPercentage
end SubIf do not understand what i mean to say so here is the example of that i want to get.


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)


