diff --git a/app/service/CrawlerService.php b/app/service/CrawlerService.php index 10a07eb..beeaaba 100644 --- a/app/service/CrawlerService.php +++ b/app/service/CrawlerService.php @@ -499,6 +499,10 @@ class CrawlerService if (mb_strlen($text) < 2 && !preg_match('/^[\x{4e00}-\x{9fa5}A-Za-z0-9]+$/u', $text)) { continue; } + // 过滤未渲染的 JS 模板(如 ' + data[i]['name'] + ' (' + data[i]['code'] + ')') + if (strpos($text, 'data[') !== false || strpos($text, "' +") !== false || strpos($text, "+ '") !== false) { + continue; + } $options[] = [ 'value' => $value,