VB.net Extract Result From Google Search

我怕爱的太早我们不能终老 提交于 2019-12-11 05:50:09

问题


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..



来源:https://stackoverflow.com/questions/13136067/vb-net-extract-result-from-google-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!