queryList CurlMulti 报错60
require_once DIR . '/../vendor/autoload.php';
use QLQueryList;
use QLExtCurlMulti;
$start = time();
$ql = QueryList::getInstance();
//or Custom function name
$ql->use(CurlMulti::class,'curlMulti');
$num = 1;
$ql->curlMulti([
'https://github.com/trending/php',
'https://github.com/trending/go'
])
// 每个任务成功完成调用此回调
->success(function (QueryList $ql,CurlMulti $curl,$r){
echo "Current url:{$r['info']['url']} \r\n";
$data = $ql->find('.p-name>a>em')->texts();
print_r($data->all());
})
// 每个任务失败回调
->error(function ($errorInfo,CurlMulti $curl){
echo "Current url:{$errorInfo['info']['url']} \r\n";
print_r($errorInfo['error']);
})
->start([
// 最大并发数
'maxThread' => 10,
// 错误重试次数
'maxTry' => 3,
]);
报错
Warning: Curl error(60) https://github.com/trending/php inC:\phpspider\queryList\vendor\ares333\php-curl\src\Curl.phpon line279
Warning: Curl error(60) https://github.com/trending/go inC:\phpspider\queryList\vendor\ares333\php-curl\src\Curl.phpon line279
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论