> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cafescraper.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 验证码使用

## **🚀 验证码绕过服务（依赖指纹浏览器）**

在使用我们的**指纹浏览器**进行数据采集或自动化操作时，若目标网站触发验证码（如滑块、人机校验等），无需自行实现复杂的识别与模拟逻辑。

我们的平台集成了 **验证码自动绕过能力**，并通过 **自定义 CDP 命令** 对外开放，开发者只需在爬虫代码中调用指定命令，即可自动完成验证码处理。

✅ 无需打码平台

✅ 无需图像识别

✅ 与浏览器环境深度融合，稳定性更高

***

## **🧠 核心能力说明**

* 通过 **CDP（Chrome DevTools Protocol）** 调用平台的验证码绕过功能
* 支持多种主流验证码类型（Cloudflare / Google / TikTok / Temu / Datadome 等）
* 阻塞式等待验证码完成，成功 / 失败状态清晰返回
* 验证码通过后即可继续执行后续业务逻辑

***

## **📌 通用调用方式**

统一使用以下 CDP 命令：

```shellscript theme={null}
Captchas.automaticSolver
```

### **参数说明**

| 参数名        | 类型     | 说明                |
| :--------- | :----- | :---------------- |
| timeout    | number | 验证码绕过最大等待时间（单位：秒） |
| solverType | string | 验证码类型（见下方对照表）     |

***

## **🧩 各爬虫框架调用示例**

### **1️⃣ DrissionPage 示例（Python）**

```python theme={null}
result = page.run_cdp(
    'Captchas.automaticSolver',   # 使用我们预定义的验证码绕过命令
    timeout=120,                  # 最大等待时间（秒）
    solverType='tiktok_slide_simple'
)

if result.get("status", False) == True:
    print("绕过成功")
else:
    print("绕过失败")
```

***

### **2️⃣ Playwright 示例（Python ）**

```python theme={null}
cdp_session = await page.context.new_cdp_session(page)

result = await cdp_session.send(
    "Captchas.automaticSolver",
    {
        "timeout": 120,
        "solverType": "tiktok_slide_simple"
    }
)

if result.get("status", False):
    print("绕过成功")
else:
    print("绕过失败")
```

***

### **3️⃣ Puppeteer 示例（Node.js）**

```javascript theme={null}
const client = await page.target().createCDPSession();

const result = await client.send('Captchas.automaticSolver', {
  timeout: 120,
  solverType: 'tiktok_slide_simple'
});

if (result.status) {
  console.log("绕过成功");
} else {
  console.log("绕过失败");
}
```

***

### **4️⃣ Selenium 示例（Python）**

```python theme={null}
result = driver.execute_cdp_cmd(
    "Captchas.automaticSolver",
    {
        "timeout": 120,
        "solverType": "tiktok_slide_simple"
    }
)

if result.get("status", False) == True:
    print("绕过成功")
else:
    print("绕过失败")
```

***

## ✅ 验证码类型对照表（solverType）

| 验证码类型                | solverType            | 示例                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| :------------------- | :-------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Cloudflare Turnstile | cloudflare            | <img src="https://mintcdn.com/cafescraper-61ea57db/qGaD3jAEpS6iVNb6/images/177018653091128006907205_210633353710_5057bcce3dd14683ad38b71b9d1137f5-1.png?fit=max&auto=format&n=qGaD3jAEpS6iVNb6&q=85&s=c2c313e7572fc2128caa71886c799ad3" alt="177018653091128006907205 210633353710 5057bcce3dd14683ad38b71b9d1137f5" title="177018653091128006907205 210633353710 5057bcce3dd14683ad38b71b9d1137f5" style={{ width:"90%" }} width="355" height="133" data-path="images/177018653091128006907205_210633353710_5057bcce3dd14683ad38b71b9d1137f5-1.png" /> |
| Google reCAPTCHA v2  | google-v2             | <img src="https://mintcdn.com/cafescraper-61ea57db/qGaD3jAEpS6iVNb6/images/28006907205_210632881730_c77bff9e0a4e4c529b8401b5b7fa0e50.png?fit=max&auto=format&n=qGaD3jAEpS6iVNb6&q=85&s=d6fbce7b9f2ef6c2d57afe0f7239b085" alt="28006907205 210632881730 C77bff9e0a4e4c529b8401b5b7fa0e50" title="28006907205 210632881730 C77bff9e0a4e4c529b8401b5b7fa0e50" style={{ width:"84%" }} width="395" height="573" data-path="images/28006907205_210632881730_c77bff9e0a4e4c529b8401b5b7fa0e50.png" />                                                                                                                                                   |
| Google reCAPTCHA v3  | google-v3             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| DataDome 滑块验证码       | datadome              | <img src="https://mintcdn.com/cafescraper-61ea57db/qGaD3jAEpS6iVNb6/images/28006907205_210629923577_e941b2430f4d4f5ba502b9ebcd8152c9.png?fit=max&auto=format&n=qGaD3jAEpS6iVNb6&q=85&s=c412159e82f02c644d73bb6ef2e095e3" alt="28006907205 210629923577 E941b2430f4d4f5ba502b9ebcd8152c9" title="28006907205 210629923577 E941b2430f4d4f5ba502b9ebcd8152c9" style={{ width:"82%" }} width="334" height="170" data-path="images/28006907205_210629923577_e941b2430f4d4f5ba502b9ebcd8152c9.png" />                                                                                                                                                   |
| OOCL Rotate Slide    | oocl\_slide           | <img src="https://mintcdn.com/cafescraper-61ea57db/qGaD3jAEpS6iVNb6/images/177018653077728006907205_210631115860_727dfcd2512e4fd098895015be493707.png?fit=max&auto=format&n=qGaD3jAEpS6iVNb6&q=85&s=41459548e47019917fd63ad4f4d8b62e" alt="177018653077728006907205 210631115860 727dfcd2512e4fd098895015be493707" width="346" height="273" data-path="images/177018653077728006907205_210631115860_727dfcd2512e4fd098895015be493707.png" />                                                                                                                        |
| Temu 全系列验证码          | temu\_auto            | <img src="https://mintcdn.com/cafescraper-61ea57db/qGaD3jAEpS6iVNb6/images/28006907205_210632073932_11d4c2a4fecd4a2d90f5d580a56a3dca.png?fit=max&auto=format&n=qGaD3jAEpS6iVNb6&q=85&s=5143e109f33742c6c6e0459609407225" alt="28006907205 210632073932 11d4c2a4fecd4a2d90f5d580a56a3dca" title="28006907205 210632073932 11d4c2a4fecd4a2d90f5d580a56a3dca" style={{ width:"81%" }} width="485" height="627" data-path="images/28006907205_210632073932_11d4c2a4fecd4a2d90f5d580a56a3dca.png" />                                                                                                                                                   |
| TikTok 滑块验证码         | tiktok\_slide\_simple | <img src="https://mintcdn.com/cafescraper-61ea57db/qGaD3jAEpS6iVNb6/images/28006907205_210628729282_34c4785d8fdd41989e0b7402746db510.png?fit=max&auto=format&n=qGaD3jAEpS6iVNb6&q=85&s=42a62307fb3f2ebf77c4dbb57f2fad65" alt="28006907205 210628729282 34c4785d8fdd41989e0b7402746db510" title="28006907205 210628729282 34c4785d8fdd41989e0b7402746db510" style={{ width:"74%" }} width="374" height="378" data-path="images/28006907205_210628729282_34c4785d8fdd41989e0b7402746db510.png" />                                                                                                                                                   |

***

## **🔚 使用说明**

当 `status = true` 时，表示验证码已成功处理，可直接继续执行登录、数据抓取、表单提交等后续业务逻辑；

若返回失败，可根据业务需要选择重试或更换验证码类型。
