21,886
社区成员
发帖
与我相关
我的任务
分享
header("Content-type: text/html; charset=utf-8");
$rch1 = curl_init();
curl_setopt($rch1, CURLOPT_URL, 'http://news.alot.com/?pr=smpl&f=1&q=napolimagazine&order=date&page=0');
curl_setopt($rch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($rch1, CURLOPT_COOKIE, "gl=IT;hl=it;nr=1;histEnable=0;suggEnable=1");
$rhtmls1 = curl_exec($rch1);
curl_close($rch1);
preg_match_all ("/<a class=\"algoTitle\" href=\"([^\"]+)\"[^<>]*>([^<>]+)<\/a>/i", $rhtmls1, $matches);
echo $matches[1][0];
$webch = curl_init();
curl_setopt($webch, CURLOPT_URL,$matches[1][0]);
//curl_setopt($webch, CURLOPT_URL,"http://www.napolimagazine.com.cn/?action=read&idnotizia=157004");
curl_setopt($webch, CURLOPT_RETURNTRANSFER, 1);
$htmls = curl_exec($webch);
curl_close($webch);
echo $htmls;