0

1、问题描述:
使用QueryList爬取https页面报错;

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in E:\wamp\www\QuerryList\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

2、代码

$ql = QueryList::get('https://tieba.baidu.com/p/5433606717?pid=115269524228&cid=0#115269524228');
$rules2 = array(
    'content' => array('#post_content_115269524228','html')
);
$content = $ql->encoding('UTF-8')->rules($rules2)->query()->getData();
print_r ($content->all());

1个回答

0

已采纳

需要设置ssl证书,或者不验证证书,例:

$ql = QueryList::get('https://...',[],['verify' => false]);

详情可以查看GuzzleHttp文档:http://guzzle-cn.readthedocs....

撰写答案