?
Solved

Data scrapping of google results in C#

Posted on 2009-03-31
2
Medium Priority
?
509 Views
Last Modified: 2012-05-06
Hi,
Can anyone please suggest a tutorial or good resource for data mining of Google results.
Actually I want to search a particular string in a Google and want to store them in my Access/MSSQL database.

Regards,
Mushi
0
Comment
Question by:Mushq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 31

Assisted Solution

by:RiteshShah
RiteshShah earned 450 total points
ID: 24036762
0
 
LVL 23

Accepted Solution

by:
Tony McCreath earned 1050 total points
ID: 24037155
Google has discontinued registering for the soap api, however they do provide a new AJAX api in its place:

http://code.google.com/apis/ajaxsearch/

Here's some code I've played with...
// rsz=small    4
// rsz=large    8
// start=4      index based
 
string url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&hl=en&rsz=large&start=0";
 
url += "&q=" + HttpUtility.UrlEncode("the search phrase");
 
url += "&key=XXXXXXXXXXXXXX";
 
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Referer = "http://www.mydomain.com/"; // Google requests you do this
 
WebResponse response = request.GetResponse();
 
StreamReader reader = new StreamReader(response.GetResponseStream());
 
string jsonResponse = reader.ReadToEnd();
 
// then parse the jsonResponse 

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question