Using CURL with Google

Posted by TheBounder on Stack Overflow See other posts from Stack Overflow or by TheBounder
Published on 2010-06-03T18:51:32Z Indexed on 2010/06/03 18:54 UTC
Read the original article Hit count: 248

Filed under:
|
|

I want to CURL to Google to see how many results it returns for a certain search.

I've tried this:

$url = "http://www.google.com/search?q=".$strSearch."&hl=en&start=0&sa=N"; $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); $response = curl_exec($ch); curl_close($ch);

But it just returns a 405 Method Allowed google error.

Any ideas?

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about google