RE: need a help 03-10-2012, 12:38 PM
#3
No i do not use webbrowser control just regular expressions.
Cuz i hate explorer browser :headbash:
Here is the code
here is i will show you that it works but after 3 hours it stops working
and onther day it works again i tired to clean cookies which google adds as ban and nothing.
Here is the pictute of my program example.
![[Image: e93fbbfb28b2dfd47dca967066634d25.png]](http://i28.fastpic.ru/big/2012/0310/25/e93fbbfb28b2dfd47dca967066634d25.png)
This program made to grab pdf txt and doc files from any search engine.
You can get anything with this code but come on guys no body knows how to fix the problem ?
Here what can you get more it scrapes and look for php forums if you like
it i have many programs like spider,scraper and so on which i'm working on but this is first problem using regex and do not know a lot of about regex programming
here is the example of the same program.
![[Image: 7f25b3b9b3b6e8f9ba6bcd3f763e6695.png]](http://i31.fastpic.ru/big/2012/0310/95/7f25b3b9b3b6e8f9ba6bcd3f763e6695.png)
Cuz i hate explorer browser :headbash:
Here is the code
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End SubCode:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
Dim wc As New WebClient
Dim source As String = wc.DownloadString("http://www.google.com/search?sclient=psy-ab&hl=lt&site=webhp&source=hp&q=" + TextBox1.Text)
Dim m1 As MatchCollection = Regex.Matches(source, "http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?\.(pdf|txt|chm|doc)", RegexOptions.Singleline + RegexOptions.IgnoreCase)
For Each m As Match In m1
Dim value As String = m.Groups(0).Value
ListBox1.Items.Add(value)
Next
Catch ex As Exception
End Try
End Sub
'remove dups from listbox
ListBox1.Sorted = True
ListBox1.Refresh()
Dim index As Integer
Dim itemcount As Integer = ListBox1.Items.Count
If itemcount > 1 Then
Dim lastitem As String = ListBox1.Items(itemcount - 1)
For index = itemcount - 2 To 0 Step -1
If ListBox1.Items(index) = lastitem Then
ListBox1.Items.RemoveAt(index)
Else
lastitem = ListBox1.Items(index)
End If
Next
End If
End Subhere is i will show you that it works but after 3 hours it stops working
and onther day it works again i tired to clean cookies which google adds as ban and nothing.
Here is the pictute of my program example.
![[Image: e93fbbfb28b2dfd47dca967066634d25.png]](http://i28.fastpic.ru/big/2012/0310/25/e93fbbfb28b2dfd47dca967066634d25.png)
This program made to grab pdf txt and doc files from any search engine.
You can get anything with this code but come on guys no body knows how to fix the problem ?
Here what can you get more it scrapes and look for php forums if you like
it i have many programs like spider,scraper and so on which i'm working on but this is first problem using regex and do not know a lot of about regex programming
here is the example of the same program.
![[Image: 7f25b3b9b3b6e8f9ba6bcd3f763e6695.png]](http://i31.fastpic.ru/big/2012/0310/95/7f25b3b9b3b6e8f9ba6bcd3f763e6695.png)

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