Comments (3)
之前以为是没传类型的问题,修改后发现问题还是会出现
相关代码:`
use QL\QueryList;
use GuzzleHttp\Psr7\Response;
use Fukuball\Jieba\Jieba;
use Fukuball\Jieba\Finalseg;
QueryList::rules($rules)->multiGet($urls)
->concurrency(5) // 设置并发数
->withOptions(['verify' => false])
->success(function(QueryList $ql, Response $res, $index) use ($rules, $task, $urls){
$images = array();
$url = $urls[$index];
try{
SH_Log::insert($task['id'], '数据爬取成功,处理中。url:'.$url);
// 爬取图片
if(isset($rules['image'])){
if(self::isWeichatPost($url)){
$rules['image'][1] = 'data-src';
}
$images = $ql->find($rules['image'][0])->attrs($rules['image'][1])->all();
}
// 获取结果
$data = $ql->rules($rules)->query()->getData()->all();
$data['url'] = $url;
if(!$this->filterCollectorResult($task, $data)){
SH_Data::deleteByUrl($url);
$this->filterFail ++;
}else{
$this->saveJiebaSpitWord($data);
$this->saveCollectorResult($task, $data, $images, $rules, $url);
}
// 最后一个任务url爬取完毕时
if($index+1 == count($urls)){
if($task['run_type'] == 'manual') SH_Task::setTaskStateById($task['id'], false);
return $this->setSuccessResult($task, count($urls));
}
}catch(Exception $e){
SH_Log::insert($task['id'], 'ERROR: 数据爬取失败,'.$e->getMessage());
}
})
->error(function(QueryList $reason, Exception $err){
// var_dump($reason, $err);
SH_Log::insert($task['id'], "ERROR: 数据爬取失败,$url ".$err->getMessage());
})
->send();`
from querylist.
src/Services/MultiRequestService.php
line 55, 这里应该是 GuzzleException
public function error(Closure $error)
{
$this->multiRequest = $this->multiRequest->error(function(GuzzleException $reason, $index) use($error){
$error($this->ql,$reason, $index);
});
return $this;
}
from querylist.
Related Issues (20)
- 设置的代理需要验证账号密码如何填写? HOT 1
- 请支持Laravel 9 谢谢 HOT 7
- 我想去掉hidden的属性怎么写? HOT 1
- php8.0 laravel 8.5 无法安装 HOT 3
- [已解决]开发环境下 依赖不兼容PHP7.4语法 HOT 1
- 可以修改富文本当中的部分内容吗? HOT 1
- 切片后数据为空
- Add support laravel 9 HOT 5
- 啥时候能支持laravel9 HOT 1
- 希望支持一下laravel9&&php8+ HOT 4
- 期望实现devtools-protocol,就能和puppeteer一样愉快的使用了 HOT 1
- 依赖库 pguardiario/phpuri 已被删除
- PHP7.4环境代码执行结果与预期不一致! HOT 3
- 使用【Baidu 插件】返回 百度安全验证 网络不给力,请稍后重试 返回首页 问题反馈 HOT 1
- 希望支持php8.0/laravel 9 HOT 2
- The domain querylist.cc is expired,please fix it
- 什么时候支持php8啊,已经在用8.2了,马上都出8.3了 HOT 4
- php8.1 fixes - Cannot push my branch
- QueryList4.2.8列表采集,不能正常执行 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from querylist.