$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl,CURLOPT_HEADER,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl,CURLOPT_PROXY,'103.228.152.11');
curl_setopt($curl,CURLOPT_PROXYPORT,'80');
curl_setopt($curl,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
if($post){
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS,$post);
}
$result = curl_exec($curl);
curl_close($curl);
$arr = array("\t" => null,"\n" => null,"\r" => null);
return strtr($result,$arr);
我从网站上提取数据,但我无法提取数据。我是第一次使用curl代理,上面的代码是否有错误?因为他不再拉它。