$url = 'http://www.weixinqun.com/group';
$ch = curl_init($url) ;
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //如果把这行注释掉的话,就会直接输出
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0');
$out = curl_exec($ch) ;
curl_close($ch);
echo $out;
curl抓取页面Demo
最新推荐文章于 2021-12-07 09:30:31 发布