• 3
  • 新人请关照

PHP使用QueryList爬取https页面报错,请问如何解决?

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());
阅读 2.2k
评论
    1 个回答
    • 454

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

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

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

      撰写回答

      登录后参与交流、获取后续更新提醒