bing

for completeness : php bing serp scraping :

$query = 'serp';
$page = 1;
$start = ($page-1)*10;
$url = 'http://www.bing.com/search?q='.urlencode($query)."&first=".($start+1);

$curl_handle = curl_init();
curl_setopt($curl_handle,CURLOPT_URL, $url);
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($curl_handle);
curl_close($curl_handle);

$parts = split('

', $return); for($j=1;$j((?:(?!).)*)#i', $p, $urls); echo "position: ".($start +$j)." url: ".$urls[1]." title: ".$urls[3].'
'; }

Posted in php, serp and tagged , .

One Comment

  1. Hey
    Good thank you :)

    You can add this variable in the url : &count=200
    I think the max is 200

Leave a Reply

Your email address will not be published. Required fields are marked *