hey guys i want to use web browser and use text box to search google
i want to add all the url in the list box but i don`t get that regex thing any helps please or any source code?
and i am using vb .net 2008
25 replies to this topic
#1
Posted 19 February 2011 - 06:51 AM
|
|
|
#2
Posted 21 February 2011 - 08:45 AM
You want to add the URL from the textBox to the listBox? Or are you trying to get the searched words out of the Google URL? I cant really tell what your trying to do.
~ Committed.
~ Committed.
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#3
Posted 22 February 2011 - 03:53 AM
bro all i want to do is to search a word and get all the websites that google shows for that word in a list box
in other words all urls of search
in other words all urls of search
#4
Posted 22 February 2011 - 10:20 AM
Try looking at this:(The reply's are at the very bottom)
regEx for pulling out google links : c# google
its in C# but you should be able to convert it.
Convert C# to VB.NET - A free code conversion tool - developer Fusion
Good luck ~ Committed.
regEx for pulling out google links : c# google
its in C# but you should be able to convert it.
Convert C# to VB.NET - A free code conversion tool - developer Fusion
Good luck ~ Committed.
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#5
Posted 23 February 2011 - 04:35 AM
well it says subscribe :S but i`ll take a look at this thanks bro i hope that would help
#6
Posted 23 February 2011 - 05:54 AM
Private Sub test14()
Dim w As New WebClient()
Dim pageSource As String = w.DownloadString("http://www.google.com/search?hl=en&q=weather&start=0")
Dim s As String = "(?<=<h3 class=r><a href="")([^""]+)"
Dim re As New Regex(s)
Dim m As MatchCollection = re.Matches(pageSource)
For i As Integer = 0 To m.Count - 1
Debug.Print("Match result {0} is ""{1}"".", i, m(i))
Next
End Sub
well this is converted and uses webrequest i want to use web browser :( and its a bit confusing for me
#7
Posted 23 February 2011 - 07:52 AM
You can still use your webBrowser just change this line
Forgive me as im not really an expert with VB. ~ Committed. :)
Dim pageSource As String = w.DownloadString("http://www.google.com/search?hl=en&q=weather&start=0")
to something like:Dim pageSource As String = w.DownloadString(webBrowser1.Url.ToString())Then when some clicks the search button or whatever, just call the function.
Forgive me as im not really an expert with VB. ~ Committed. :)
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#8
Posted 23 February 2011 - 10:27 PM
well atleast you are good tht u can modify tht even after tht i don`t get it how to use it :(
#9
Posted 24 February 2011 - 01:34 AM
well i did tht to get source code of the page
the next problem is that how can i make regex of this ??
<a href="http://www.ourbrisbane.com/see-and-do/places-to-see/valley-lakes" class="l" onmousedown="return clk(this.href,'','','','10','','0CFoQFjAJ')">
i just want the url "http://www.ourbrisbane.com/see-and-do/places-to-see/valley-lakes" this thing out of this from all sites how to make regex for this?
m doing it like
Dim r As System.Text.RegularExpressions.Regex((""<a href=""http://.*"" class=""l"")
but i get the error how to fix it?
the next problem is that how can i make regex of this ??
<a href="http://www.ourbrisbane.com/see-and-do/places-to-see/valley-lakes" class="l" onmousedown="return clk(this.href,'','','','10','','0CFoQFjAJ')">
i just want the url "http://www.ourbrisbane.com/see-and-do/places-to-see/valley-lakes" this thing out of this from all sites how to make regex for this?
m doing it like
Dim r As System.Text.RegularExpressions.Regex((""<a href=""http://.*"" class=""l"")
but i get the error how to fix it?
#10
Posted 24 February 2011 - 06:57 AM
Hmm the Regex looks fine to me, could you post the error your receiving?
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
#11
Posted 24 February 2011 - 04:19 PM
the error says array bound cannot appear in type specifiers
this source i took from mozilla firefox but the source i get using internet explorer is different how to get that fixed?
this source i took from mozilla firefox but the source i get using internet explorer is different how to get that fixed?
#12
Posted 24 February 2011 - 06:18 PM
If you are wanting just URL addresses, the following regular expression should work:
Although I think you may need to be a little more specific, are you wanting more than just the URL?
((?:http|https)(?::\/{2}[\w]+)(?:[\/|\.]?)(?:[^\s""]*))
Although I think you may need to be a little more specific, are you wanting more than just the URL?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









