From 693fde8991a1e6f6c86a7b5ad33d73a42948275c Mon Sep 17 00:00:00 2001 From: toom1996 Date: Wed, 30 Jul 2025 16:13:48 +0800 Subject: [PATCH] update --- app/Command/spider/BaiduRecordCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Command/spider/BaiduRecordCommand.php b/app/Command/spider/BaiduRecordCommand.php index 7a094c4..318a014 100644 --- a/app/Command/spider/BaiduRecordCommand.php +++ b/app/Command/spider/BaiduRecordCommand.php @@ -58,6 +58,7 @@ class BaiduRecordCommand extends BaseSpider // 采集新闻板块 private function _start(int|bool $id = false) { + $times = 0; $cache = []; $requestCookie = ''; $query = AppNews::query() @@ -97,8 +98,11 @@ class BaiduRecordCommand extends BaseSpider if (stripos($res, '验证') !== false || stripos($res, 'wappass') !== false) { $this->log->info('有验证码!!'); + $times++; // 有验证码就跳出 - return; + if ($times > 1) { + return; + } } (new Crawler($res))?->filter('.abs')?->each(function ($node) use ($domain, $item) {