Google results URL list (poor mans style)

Boxic

Newbie
Joined
Dec 20, 2008
Messages
7
Reaction score
3
I spent longer on google trying to find something that would give me a list of urls from the google SERPS than it would have taken just to slap something together:

I cant post links, but you need to generate your search url using

h t t p : // google . com / ie

the /ie part is very important.

You can append &num=100 to the url to get 100 results, and &start=100 to get results 100+

Do what you like with it, maybe i will find this on google next time i need it :)

Code:
<?

$url = "
h t t p : / / w w w . google . com/ie?q=QUERY&num=100
";
$google_page = file_get_contents(trim($url));


$regex = '/<a title="(.*?)" href=(.*?)>(.*?)<\/a>/i';
preg_match_all($regex,$google_page,$google_links);
echo "<pre>";
//var_dump( $google_links );

foreach ($google_links[2] as $link)
{
        echo $link . "\r";
}
echo "</pre>";
?>
 
Thanks mate, this is something I've been looking for quite a while!
 
I am looking for a script which can grab the URLs from Google SERPs for any given keyword phrase. Please let me know the details how I can use the above script or if there is any readymade tool which can automate this task.
 
Thanks for the share. Unfortunately, without the integration and use of proxies, this script won't scale.
 
Back
Top