This worked for me.
$i = 1;
$links = array();
$baseUrl = "http://www.gites-de-france.com/location-vacances-chambre-hotes.html";
$param = array(
'chambre' => 'o',
'xhtml' => 'O',
'acc' => 'CHAMBRE,CHAMBRE',
'order_by' => 'prix',
'order_by_tri' => 'asc'
);
while($i < 3) {
$ch = curl_init();
$param['page'] = $i;
$url = "{$baseUrl}?" . http_build_query($param);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, "http://www.google.fr/");
curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
$html = curl_exec($ch);
curl_close($ch);
$doc = phpQuery::newDocument($html);
foreach($doc['.vignette a'] as $a){
$url = '';
$links[] .= pq($a)->attr('href');
}
$i++;
}
print_r($links);
Note: I created the cookie.txt
file manually before running the script.