Jump to content



Photo

Query Google with VB.NET


  • Please log in to reply
11 replies to this topic

#1 +ChuckFinley

ChuckFinley

    member_id=28229

  • Joined: 14-May 03

Posted 23 February 2014 - 21:41

Forgive my ignorance however I thought this is the best place to ask, I have been out of the programming game for a while now. My background is .NET (VB). What is the correct and up to date method that would allow me to query Google and extract this information? I did use a method before a few years back but access to this is stopped.

 

Thanks




#2 n_K

n_K

    Neowinian Senior

  • Tech Issues Solved: 3
  • Joined: 19-March 06
  • Location: here.
  • OS: FreeDOS
  • Phone: Nokia 3315

Posted 23 February 2014 - 21:46

How 'dirty' do you want to do it?
You could use an IE active x and do it like that.



#3 XerXis

XerXis

    Neowinian Senior

  • Tech Issues Solved: 2
  • Joined: 13-February 06
  • Location: Belgium

Posted 23 February 2014 - 21:46

This would be the api to use:

 

https://developers.g...api/v1/overview

 

However, you can only do 100 queries a day.

 

Another way would be to just query the website with say WebClient and parse the html for the results. But that is very dirty and I don't recommend it, certainly not if you are planning on distributing your software



#4 +virtorio

virtorio

    4089 III

  • Tech Issues Solved: 11
  • Joined: 28-April 03
  • Location: New Zealand
  • OS: OSX 10.9, Windows 8.1
  • Phone: Samsung Galaxy SIII

Posted 23 February 2014 - 21:49

You could use HttpWebRequest to perform a search in Google and parse the response using an HTML parser or regular expressions, but do so knowing it will almost certainly break in the future.



#5 OP +ChuckFinley

ChuckFinley

    member_id=28229

  • Joined: 14-May 03

Posted 23 February 2014 - 21:52

Yeah thats how I would have done it but parsing the HTML would be a dirty way to do it. I dont plan on putting my code into production at all its merely for self interest and curiosity and to stop my mind going stale.



#6 XerXis

XerXis

    Neowinian Senior

  • Tech Issues Solved: 2
  • Joined: 13-February 06
  • Location: Belgium

Posted 23 February 2014 - 21:56

Yeah thats how I would have done it but parsing the HTML would be a dirty way to do it. I dont plan on putting my code into production at all its merely for self interest and curiosity and to stop my mind going stale.

Well, the link I gave you contains all the information, if you want to test it:

 

https://developers.g...search.cse.list

 

The easiest way to use it from vb.net would be using WebClient and parsing the result with the newtonsoft json library :)



#7 OP +ChuckFinley

ChuckFinley

    member_id=28229

  • Joined: 14-May 03

Posted 23 February 2014 - 22:11

Think I am going to have to do alot of reading, I cant find any good code examples.



#8 Ryano121

Ryano121

    Neowinian

  • Joined: 07-August 10

Posted 23 February 2014 - 22:22

I'm pretty sure parsing the HTML results from queries breaks Google's terms of service as well. Best to use the API's they provide.



#9 +virtorio

virtorio

    4089 III

  • Tech Issues Solved: 11
  • Joined: 28-April 03
  • Location: New Zealand
  • OS: OSX 10.9, Windows 8.1
  • Phone: Samsung Galaxy SIII

Posted 23 February 2014 - 22:24

Yeah, I just had a look for the hell of it and they don't return any results in the initial response anyway. Use the APIs.



#10 OP +ChuckFinley

ChuckFinley

    member_id=28229

  • Joined: 14-May 03

Posted 24 February 2014 - 13:04

Can anyone tell me if these are still relevant?

 

This looks like such a nice way to work?

 

http://code.google.c...api-for-dotnet/

 

https://developers.g...ry/dotnet/apis/

 

http://social.msdn.m...forum=vbgeneral



#11 OP +ChuckFinley

ChuckFinley

    member_id=28229

  • Joined: 14-May 03

Posted 27 February 2014 - 21:04

Google was too difficult to get an API for the search. I went for Bing Instead. Much Easier to do what I want. 



#12 OP +ChuckFinley

ChuckFinley

    member_id=28229

  • Joined: 14-May 03

Posted 02 March 2014 - 18:20

This is what I am creating, Its not so much an E-Mail scraper...