Sign in to follow this  
Followers 0

Query Google with VB.NET

12 posts in this topic

Posted

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

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

This would be the api to use:

 

https://developers.google.com/custom-search/json-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

Share this post


Link to post
Share on other sites

Posted

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.

Share this post


Link to post
Share on other sites

Posted

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.

Share this post


Link to post
Share on other sites

Posted

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.google.com/apis-explorer/#p/customsearch/v1/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 :)

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

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.

Share this post


Link to post
Share on other sites

Posted

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.

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

Posted

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

 

http://youtu.be/OizvG5bq5NA

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.