VB.net Extract Result From Google Search

2019-08-12 07:50发布

问题:

I want to extract google search result,
I'm using the Google.API.Search,

I tried to extract result by this code:

Dim client As New GwebSearchClient("http://www.google.co.il")
Dim results As IList(Of IWebResult) = client.Search("test", 64)
For Each result As IWebResult In results
            ListBox1.Items.Add(result.Url)
Next
Me.Text = ListBox1.Items.Count

This code works partially
the result is limited to 64 results.
i want to get 400 results,
there is another way to get result from google?
(I prefer not using the Google.API.Search , maybe get the result by "regex")
I'd love any other way.

回答1:

I'm not sure how this is working. But there is a integer next to the string "test" that equals 64. You are getting 64 results so I guess that could be it.

Dim client As New GwebSearchClient("http://www.google.co.il")
Dim results As IList(Of IWebResult) = client.Search("test", 400)
For Each result As IWebResult In results
            ListBox1.Items.Add(result.Url)
Next
Me.Text = ListBox1.Items.Count

Change the code to the above, should be fine!



回答2:

Sadly the google search api limits the search to 64 no matter if you set the limitation to exceed that. At least that's what I read in their documentation..