GoogleSearch API Results

BillyHoliday

New member
Joined
Sep 8, 2006
Messages
3
Programming Experience
Beginner
Hello everyone,
I wanted to see if anyone has had any luck retrieving results with the googlesearch api. I’ve seen a lot of tutorials and the demo that returns number of results and query time, but I haven’t seen any examples on how to return the actual results. I’ve tried to return the values stored in the resultselements array but haven’t had any luck figuring out how to view the actual url’s, snippents, summary and things of that nature. Can anyone point me in the direction of a tutorial, or suggest something that may work.

Thanks,
BHoliday
 
The resultElements property is an array of resultElement, the type is given by the web service, so if your web service namespace is Google it gives Google.resultElement. Example (the demo makes Dim r As Google.GoogleSearchResult), of course you want to do something useful with the result members instead of showing lots of messageboxes.. just to give an idea of how to retrieve them :)
VB.NET:
For Each res As Google.ResultElement In r.resultElements
  MsgBox(res.URL)
  MsgBox(res.title)
  MsgBox(res.summary)
Next
The kit is at http://www.google.com/apis/index.html if others want to try. (demo and reference documentation is included)
 
John,

thanks for the tip, I was able to display the results and display them in a list box and also write to a file. Thanks for you help!

Bholiday
 
Back
Top