我从谷歌刮了几页..其中一页返回给我:
File : C:\xampp\htdocs\PPC-Advert-System\Scrapper\ScrapperDBCRUD.php
Line: 29
SSL certificate problem, verify that the CA cert is OK. Details:\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
这是我的卷曲代码:
private function getPage($proxy, $url, $referer, $agent, $header, $timeout) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_HEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// curl_setopt($ch, CURLOPT_REFERER, $referer);
// curl_setopt($ch, CURLOPT_USERAGENT, $agent);
$result['EXE'] = curl_exec($ch);
$result['INF'] = curl_getinfo($ch);
$result['ERR'] = curl_error($ch);
if(curl_exec($ch) === false)
{
$result['ERR']=curl_error($ch);
}
curl_close($ch);
return $result;
}
我不知道要向 curl 添加什么内容,因此它以某种方式验证了我要抓取的页面。而且,我不知道它是否会影响我抓取的普通页面的抓取..解决这个问题的最佳方法是什么?!?
我有时也会收到此错误:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
这两个错误是否相关?