want to make tool that scrape 10 first results from google

forvenz

Regular Member
Joined
Jan 25, 2013
Messages
472
Reaction score
74
Hi ,
I prefer to do that with javascript or with java , but if there is a better language that suit for this job so no problem .
I want to make a tool that get a input (X numbers of keywords ) and return the 10 first url in google to each of these keywords .
how can I do that? Do I need to use google api?
 

DiamonMike

Regular Member
Joined
Aug 22, 2013
Messages
219
Reaction score
63
Or try Market Samurai....it does exactly what you want
 

divok

Senior Member
Joined
Jul 21, 2010
Messages
1,071
Reaction score
656
Install Scraper for Google Chrome if you are planning to use it for personal use .
Python has better libraries for scraping & you can convert it to windows program easily or run on linux .
also try zenno and ubot .
 

Shirko

Regular Member
Joined
Aug 11, 2012
Messages
200
Reaction score
175
Any language is good for doing this task... this is way too simple.

You just need to know programming or hire someone to do it for you.
 

forvenz

Regular Member
Joined
Jan 25, 2013
Messages
472
Reaction score
74
I know little bit programming but I need a direction how to do that ,
and with scrape box it won't scrape the 10 first results
 

mypmmail

Junior Member
Joined
Jan 31, 2008
Messages
114
Reaction score
27
What you can do is to look at the google result html code.

e.g.
when using Firefox, the google result has the
Code:
<div id="ires" data-async-context="query:your_query_string">
<ol id="rso" eid="lkdjhaaifubiuad">
<li class="g">
<div data-hveid="44" class="rc"><span class="altcts"></span><h3 class="r"><a href="......">1st result title</a></h3>
</li>

// ......  the <li> will repeat for each result

</ol>
</div>

With this known format, you can sieve through the source by looking for the string data-async-context and extract the result as you wish from there on.


hth
 

forvenz

Regular Member
Joined
Jan 25, 2013
Messages
472
Reaction score
74
yes but how can I access the data?
what function give me access to the data of a web page?
 

garthor

Newbie
Joined
Mar 24, 2013
Messages
48
Reaction score
13
This task can be done in many different languages. If i were you I would use Visual Basic,
You can take advantage of the webbrowser component. Simply make it navigate to the page you'd like
and then it's all about parsing the HTML document in the webbrowser.
 

mypmmail

Junior Member
Joined
Jan 31, 2008
Messages
114
Reaction score
27
yes but how can I access the data?
what function give me access to the data of a web page?

If you are using PHP, then you can use cURL.

If you are using java, then URLConnection. Or, if you are using a library, use HttpClient

If you are using javascript, then you need to use an ajax call using XMLHttpRequest

hth
 
Last edited:

tratata

Newbie
Joined
Jul 26, 2013
Messages
14
Reaction score
5
Better to use specialized software. Because after simple script development would be needed proxy support, captcha filling and etc
 

termseo

Junior Member
Joined
Nov 4, 2010
Messages
103
Reaction score
161
it can be done by most languages, you want to code it from scrach ? or you are searching for available softwares which do the task ? cause the most of tools do it...
 

justone

BANNED
Joined
Oct 12, 2008
Messages
1,521
Reaction score
1,054
You will find a full featured PHP source for scraping Google at http://google-rank-checker.squabbel.com
To only scrape the 10 first results you need to set it to 1 result page and the number of results per page to 10.

It is open source so you can use the code for your stuff but converting that one to javascript or java would be difficult, but after all PHP is a very nice language and easy to understand.
 

Gogol

Jr. VIP
Jr. VIP
Joined
Sep 10, 2010
Messages
9,901
Reaction score
17,180
Website
twitter.com
Not sure how you would scrape google with just javascript, but I did make a keyword tracker project using PHP which can be useful here. You will need to modify it to return the urls instead of the position of your domain. The basic fetch algo will remain the same.
Check that thread here:
http://www.blackhatworld.com/blackh...serp-position-checker-script-written-php.html

Let me know if you are unsure about something there. :)
 
Top