# 判断验证码类型

> 怎么判断网页上是哪种验证码：reCAPTCHA v2、v2 隐形版、v3、企业版，hCaptcha，Cloudflare Turnstile 和 5 秒盾的区别，以及对应用哪个 YesCaptcha 任务类型。

Source: https://docs.yescaptcha.com/zh/guides/identify-captcha/ · Last verified: 2026-10-15

选对任务类型的第一步是认出验证码。最可靠的办法是打开浏览器的开发者工具（F12），在 Network（网络）面板里看网页加载了哪个验证码的脚本；也可以从外观判断。

## 速查表

| 你看到的 | 是什么 | 用哪个任务类型 |
| --- | --- | --- |
| “进行人机身份验证 / I’m not a robot”复选框 | reCAPTCHA v2 | [reCAPTCHA v2](https://docs.yescaptcha.com/zh/tasks/recaptcha-v2/) |
| 没有复选框，点提交才弹出图片题；右下角有 reCAPTCHA 小标 | reCAPTCHA v2 隐形版（或 v3） | 见下面“reCAPTCHA 的版本” |
| 没有任何交互，右下角只有 reCAPTCHA 小标 | reCAPTCHA v3 | [reCAPTCHA v3](https://docs.yescaptcha.com/zh/tasks/recaptcha-v3/) |
| “我是人类”复选框，图片题标着 hCaptcha | hCaptcha | [hCaptcha](https://docs.yescaptcha.com/zh/tasks/hcaptcha/) |
| 表单里嵌着 Cloudflare 的验证框，打勾后页面不跳转 | Cloudflare Turnstile | [Turnstile](https://docs.yescaptcha.com/zh/tasks/turnstile/) |
| 整个页面显示“请稍候… / 正在检查您的连接”，自动跳转 | Cloudflare 5 秒盾 | [Cloudflare 5 秒盾](https://docs.yescaptcha.com/zh/tasks/cloudflare-challenge/) |
| Arkose Labs 的拼图、选图题（如“选出正确朝上的图片”） | FunCaptcha | [FunCaptcha](https://docs.yescaptcha.com/zh/tasks/funcaptcha/) |
| 一张带扭曲字母数字的图片 | 字符验证码 | [图片英数字识别](https://docs.yescaptcha.com/zh/tasks/image-to-text/) |

## reCAPTCHA 的版本

在 Network 面板里搜索 `api.js` 或 `enterprise.js`：

| 加载的脚本 | 版本 |
| --- | --- |
| `recaptcha/api.js`，没有 `render` 参数或 `render=explicit` | v2 普通版 |
| 同上，并且 `anchor` 请求的地址里有 `size=invisible` | v2 隐形版，任务里加 `"isInvisible": true` |
| `recaptcha/api.js?render=网站密钥`（`render` 不是 `explicit`） | v3 普通版 |
| `recaptcha/enterprise.js`，没有 `render` 参数或 `render=explicit` | v2 企业版 |
| `recaptcha/enterprise.js?render=网站密钥` | v3 企业版 |

例子：

```text
https://www.google.com/recaptcha/api.js?onload=onloadcallback&render=explicit   → v2 普通版
https://www.google.com/recaptcha/api.js?render=6LdyC2cUAAAAACGuDKpXeDorzUDWXmdqeg-xy696   → v3 普通版
https://www.google.com/recaptcha/enterprise.js?render=explicit   → v2 企业版
```

v2 隐形版有时用 v3 的类型才能通过，两种都可以试试。

也可以在控制台（Console）里运行下面这段代码，它会列出页面上所有 reCAPTCHA 的版本、网站密钥、页面地址和回调函数：

find-recaptcha-clients.js

```js
// Paste into the browser DevTools console on a page with reCAPTCHA, then run findRecaptchaClients().
// Lists every reCAPTCHA on the page: version (V2/V3), sitekey, page URL and the callback function.
function findRecaptchaClients() {
  if (typeof ___grecaptcha_cfg === 'undefined') return [];
  return Object.entries(___grecaptcha_cfg.clients).map(([cid, client]) => {
    const data = { id: cid, version: cid >= 10000 ? 'V3' : 'V2' };
    const objects = Object.entries(client).filter(([, value]) => value && typeof value === 'object');
    objects.forEach(([toplevelKey, toplevel]) => {
      const found = Object.entries(toplevel).find(
        ([, value]) => value && typeof value === 'object' && 'sitekey' in value && 'size' in value,
      );
      if (toplevel instanceof HTMLElement && toplevel.tagName === 'DIV') data.pageurl = toplevel.baseURI;
      if (found) {
        const [sublevelKey, sublevel] = found;
        data.sitekey = sublevel.sitekey;
        const callbackKey = data.version === 'V2' ? 'callback' : 'promise-callback';
        const callback = sublevel[callbackKey];
        if (!callback) {
          data.callback = null;
          data.function = null;
        } else {
          data.function = callback;
          const keys = [cid, toplevelKey, sublevelKey, callbackKey].map((key) => `['${key}']`).join('');
          data.callback = `___grecaptcha_cfg.clients${keys}`;
        }
      }
    });
    return data;
  });
}

findRecaptchaClients();
```

运行结果示例：

```json
[
  {
    "id": "0",
    "version": "V2",
    "sitekey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
    "function": "onSuccess",
    "callback": "___grecaptcha_cfg.clients['0']['l']['l']['callback']",
    "pageurl": "https://www.google.com/recaptcha/api2/demo"
  }
]
```

Google 的官方演示页可以用来对照：v2 普通版 `https://www.google.com/recaptcha/api2/demo`，v2 隐形版 `https://www.google.com/recaptcha/api2/demo?invisible=true`。

## Turnstile 和 5 秒盾

两者都来自 Cloudflare，但不是同一种：

-   **Turnstile** 是嵌在网页表单里的一个验证框，验证完成后打勾，页面本身不跳转。网页加载 `challenges.cloudflare.com/turnstile/v0/api.js`。用 [Turnstile](https://docs.yescaptcha.com/zh/tasks/turnstile/)。
-   **5 秒盾** 是整个页面都被替换成 Cloudflare 的检查页，显示“请稍候…”“xx.com 需要先检查您的连接的安全性”，里面可能也有一个验证框；通过后自动跳到真正的页面。源码里有 `__cf_chl_rt_tk` 或 `cdn-cgi/challenge-platform`。用 [Cloudflare 5 秒盾](https://docs.yescaptcha.com/zh/tasks/cloudflare-challenge/)。

用程序请求时返回 403 和“Just a moment…”，但用浏览器能直接打开的，多半只是 TLS 指纹被拦，换用能模拟浏览器 TLS 指纹的库（例如 curl\_cffi）就能请求，不需要过盾。
