Using C # to retrieve data from a Google search

Here I want the program to execute:

  • Read the text file (the text file contains random search criteria such as “sunflower seeds”, “chrome taps for water”, etc.) to get a search phrase.
  • Submit your search phrase to Google and get the first four URLs.
  • Get the Google Page Rank for each of the returned URLs.

As a C # neophyte programmer, I can easily handle C # 1. Unfortunately, I have never considered using the Google APIs before. I have a Google API key and I know that there is a restriction on access using the API. At best, I will probably use this on a dozen search phrases (or “keywords”) per day. I can do it manually, but I know there must be a way to do this using a C # program. I read that this can be done using AJAX, but I do not know AJAX, and I would prefer it to be an executable program on my PC, rather than a web application. A push in the right direction from someone would be a big help. In addition, I really do not want it to be a "scraper screen." There is no waywith which I can get information (URLs and Page Rank) from Google without having to clear the page with the return of the HTML page?

I don’t want anyone to write code for me, I just need to know, if possible, and a push to find information on how to execute it.

Thanks in advance to everyone!

+3
source share
2 answers

I don’t want anyone to write code for me; you just need to know if this is possible and push to search for information on how to execute it.

Take a look at the WebClient class

http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx

+3
source

Try the following:

googleSearch = @"http://" + @"www.google.com/#hl=en&q="+@query;

where the query is your search string.

0
source

Source: https://habr.com/ru/post/1775551/


All Articles