优化爬虫,增加缓存,线程池,保存浏览器用户信息
This commit is contained in:
+12
-1
@@ -26,6 +26,8 @@ class Chatknow extends AbstractScrmSpider
|
||||
|
||||
protected function getSpiderConfig()
|
||||
{
|
||||
$host = (string) parse_url($this->pageUrl, PHP_URL_HOST);
|
||||
|
||||
return [
|
||||
'pageUrl' => $this->pageUrl,
|
||||
'apiUrls' => [self::API_LIST],
|
||||
@@ -43,7 +45,16 @@ class Chatknow extends AbstractScrmSpider
|
||||
// ['type' => 'vue_click', 'selector' => '.layui-btn', 'text' => '搜索'],
|
||||
|
||||
['type' => 'wait', 'ms' => 4000]
|
||||
]
|
||||
],
|
||||
// ChatKnow 专用:Real Browser + Turnstile + Captcha API 兜底 + 会话复用
|
||||
'antiBot' => [
|
||||
'enabled' => true,
|
||||
'profile' => 'real',
|
||||
'turnstile' => true,
|
||||
'solverFallback' => true,
|
||||
'sessionKey' => 'chatknow:' . $host,
|
||||
'challengeTimeoutMs' => 60000,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user