Cả hai phiên bản đều chạy ẩn và trả về điểm rủi ro (0,0 đến 1,0). Doanh nghiệp bổ sung mã lý do, ngưỡng thích ứng và quản lý dự án Google Cloud — nhưng từ góc độ giải quyết CaptchaAI, điểm khác biệt duy nhất về tham số là enterprise=1. Thách thức là phát hiện phiên bản nào trang web sử dụng vì cả hai đều vô hình.
So sánh tính năng
| tính năng | Tiêu chuẩn v3 | Doanh nghiệp v3 |
|---|---|---|
| Hoạt động vô hình | Có | Có |
| Điểm (0,0–1,0) | Có | Có |
| Tham số hành động | Bắt buộc | Bắt buộc |
| tập tin JS | api.js?render=KEY |
enterprise.js?render=KEY |
| Thực thi chức năng | grecaptcha.execute() |
grecaptcha.enterprise.execute() |
| Mã lý do | Không | Có (TỰ ĐỘNG, TOO_MUCH_TRAFFIC, v.v.) |
| Ngưỡng tùy chỉnh cho mỗi hành động | Không | Có (thông qua Cloud Console) |
| Phát hiện rò rỉ mật khẩu | Không | Có |
| Người bảo vệ tài khoản | Không | Có |
| Điểm cuối xác minh | siteverify (miễn phí) |
recaptchaenterprise.googleapis.com (trả phí) |
| Thông số CaptchaAI | version=v3 |
version=v3 + enterprise=1 |
| Thời gian giải quyết điển hình | 10-20 giây | 10-20 giây |
Cách phát hiện phiên bản nào trang web sử dụng
Vì cả hai phiên bản đều ẩn (không có tiện ích hiển thị), nên việc phát hiện phải dựa vào JavaScript:
Phát hiện Python:
import requests
import re
def detect_v3_type(url):
resp = requests.get(url)
html = resp.text
# Check for enterprise.js
if "enterprise.js" in html:
version = "enterprise_v3"
execute_fn = "grecaptcha.enterprise.execute"
elif "recaptcha/api.js" in html and "render=" in html:
version = "standard_v3"
execute_fn = "grecaptcha.execute"
else:
return None
# Extract sitekey from render parameter
key_match = re.search(r'render[=:]\s*["\']?([A-Za-z0-9_-]{40})', html)
sitekey = key_match.group(1) if key_match else None
# Extract action parameter
action_match = re.search(r'action["\']?\s*[:=]\s*["\'](\w+)', html)
action = action_match.group(1) if action_match else "unknown"
return {
"version": version,
"sitekey": sitekey,
"action": action,
"execute_fn": execute_fn
}
info = detect_v3_type("https://staging.example.com/qa-login")
print(info)
Phát hiện Node.js:
const axios = require("axios");
async function detectV3Type(url) {
const { data: html } = await axios.get(url);
let version, executeFn;
if (html.includes("enterprise.js")) {
version = "enterprise_v3";
executeFn = "grecaptcha.enterprise.execute";
} else if (html.includes("recaptcha/api.js") && html.includes("render=")) {
version = "standard_v3";
executeFn = "grecaptcha.execute";
} else {
return null;
}
const keyMatch = html.match(/render[=:]\s*['"]?([A-Za-z0-9_-]{40})/);
const actionMatch = html.match(/action['"]?\s*[:=]\s*['"](\w+)/);
return {
version,
sitekey: keyMatch?.[1] || null,
action: actionMatch?.[1] || "unknown",
executeFn,
};
}
Kiểm tra nhanh bảng điều khiển trình duyệt:
// Paste in DevTools console
if (document.querySelector('script[src*="enterprise.js"]')) {
console.log("Enterprise v3");
console.log("Execute:", typeof grecaptcha?.enterprise?.execute);
} else if (document.querySelector('script[src*="api.js"][src*="render="]')) {
console.log("Standard v3");
console.log("Execute:", typeof grecaptcha?.execute);
}
Giải quyết bằng CaptchaAI
Tiêu chuẩn v3
import requests
import time
# Submit
resp = requests.get("https://ocr.captchaai.com/in.php", params={
"key": "YOUR_API_KEY",
"method": "userrecaptcha",
"version": "v3",
"googlekey": sitekey,
"action": "login",
"pageurl": page_url
})
task_id = resp.text.split("|")[1]
# Poll
for _ in range(60):
time.sleep(5)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": "YOUR_API_KEY", "action": "get", "id": task_id
})
if result.text.startswith("OK|"):
token = result.text.split("|")[1]
break
Doanh nghiệp v3
import requests
import time
# Submit — add enterprise=1
resp = requests.get("https://ocr.captchaai.com/in.php", params={
"key": "YOUR_API_KEY",
"method": "userrecaptcha",
"version": "v3",
"enterprise": 1, # Required for Enterprise
"googlekey": sitekey,
"action": "login",
"pageurl": page_url
})
task_id = resp.text.split("|")[1]
# Polling is identical to standard
for _ in range(60):
time.sleep(5)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": "YOUR_API_KEY", "action": "get", "id": task_id
})
if result.text.startswith("OK|"):
token = result.text.split("|")[1]
break
Bộ giải phổ quát với tính năng tự động phát hiện
import requests
import time
import re
class RecaptchaV3Solver:
def __init__(self, api_key):
self.api_key = api_key
def detect_and_solve(self, page_url, action=None):
"""Auto-detect standard vs enterprise and solve."""
html = requests.get(page_url).text
is_enterprise = "enterprise.js" in html
key_match = re.search(r'render[=:]\s*["\']?([A-Za-z0-9_-]{40})', html)
if not key_match:
raise Exception("No v3 sitekey found")
sitekey = key_match.group(1)
if not action:
action_match = re.search(r'action["\']?\s*[:=]\s*["\'](\w+)', html)
action = action_match.group(1) if action_match else "verify"
params = {
"key": self.api_key,
"method": "userrecaptcha",
"version": "v3",
"googlekey": sitekey,
"action": action,
"pageurl": page_url
}
if is_enterprise:
params["enterprise"] = 1
resp = requests.get("https://ocr.captchaai.com/in.php", params=params)
if not resp.text.startswith("OK|"):
raise Exception(f"Submit failed: {resp.text}")
task_id = resp.text.split("|")[1]
for _ in range(60):
time.sleep(5)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": self.api_key, "action": "get", "id": task_id
})
if result.text.startswith("OK|"):
return result.text.split("|")[1]
if result.text != "CAPCHA_NOT_READY":
raise Exception(f"Solve failed: {result.text}")
raise Exception("Timed out")
solver = RecaptchaV3Solver("YOUR_API_KEY")
token = solver.detect_and_solve("https://staging.example.com/qa-login", action="login")
print(f"Token: {token[:40]}...")
Những lỗi thường gặp
| sai lầm | kết quả | sửa chữa |
|---|---|---|
Sử dụng enterprise=1 trên v3 tiêu chuẩn |
Mã thông báo có thể không hợp lệ | Kiểm tra enterprise.js trước khi thêm cờ |
Bỏ qua enterprise=1 trên Enterprise v3 |
Mã thông báo bị từ chối bởi chương trình phụ trợ | Luôn thêm khi có enterprise.js |
Tham số action sai |
Điểm thấp, mã thông báo bị từ chối | Trích xuất chuỗi hành động chính xác từ trang JavaScript |
Bỏ qua version=v3 |
Bộ giải coi nó là v2 | Luôn bao gồm version=v3 cho reCAPTCHA dựa trên điểm số |
| Sử dụng sitekey v2 để giải quyết v3 | ERROR_WRONG_GOOGLEKEY |
Khóa trang web v3 đến từ tham số render=KEY |
Trích xuất tham số hành động
Tham số action rất quan trọng đối với v3 - cả tiêu chuẩn và doanh nghiệp. Nếu bạn gửi hành động sai, điểm sẽ thấp và mã thông báo có thể bị từ chối.
import re
def find_v3_actions(html):
"""Extract all action parameters from page JavaScript."""
# Look for grecaptcha.execute(key, {action: '...'})
pattern = r"(?:grecaptcha\.(?:enterprise\.)?execute|action)\s*[(:]\s*['\"](\w+)"
actions = re.findall(pattern, html)
return list(set(actions))
# Common actions: "login", "submit", "register", "checkout", "homepage"
Tiêm mã thông báo
Cách tiếp cận tương tự cho cả hai phiên bản:
# For browser-based workflows (Selenium)
driver.execute_script(
f'document.getElementById("g-recaptcha-response").value = "{token}";'
)
# For pure HTTP workflows
requests.post(page_url, data={
"g-recaptcha-response": token,
"username": "user",
"password": "pass"
})
// Puppeteer
await page.evaluate((tok) => {
document.getElementById("g-recaptcha-response").value = tok;
}, token);
// Pure HTTP (axios)
await axios.post(pageUrl, new URLSearchParams({
"g-recaptcha-response": token,
username: "user",
password: "pass",
}));
Câu hỏi thường gặp
Enterprise v3 có cho điểm khác nhau không?
Mô hình tính điểm tương tự nhưng Doanh nghiệp có thể sử dụng các tín hiệu và ngưỡng tùy chỉnh bổ sung. CaptchaAI xử lý cả hai cách giống hệt nhau — mã thông báo được trả về hoạt động bất kể Google sử dụng mô hình nào.
Làm cách nào để phát hiện Enterprise v3 trên một trang?
Hãy tìm enterprise.js thay vì api.js trong thẻ tập lệnh và grecaptcha.enterprise.execute() trong JavaScript. Cả hai đều vô hình nên không có sự khác biệt về mặt hình ảnh.
Giải pháp Enterprise v3 có đắt hơn không?
Kiểm tra giá hiện tại của CaptchaAI. Các giải pháp dành cho doanh nghiệp có thể được định giá khác nhau nhưng nỗ lực tích hợp API giống hệt với tiêu chuẩn.
Nếu tôi không thể tìm thấy tham số hành động thì sao?
Hãy thử các giá trị chung: "verify", "submit", "homepage", "login". Nếu mã thông báo vẫn bị từ chối, hãy sử dụng DevTools của trình duyệt để tìm kiếm execute( trong tập lệnh trang và tìm chuỗi hành động chính xác.
Một trang web có thể chuyển đổi giữa tiêu chuẩn và doanh nghiệp mà không cần thông báo không?
Vâng. Các trang web có thể di chuyển sang Enterprise bất kỳ lúc nào. Xây dựng khả năng phát hiện của bạn để chạy trên mỗi lần tải trang thay vì mã hóa phiên bản.
Hướng dẫn liên quan
- reCAPTCHA v3 Enterprise so với tiêu chuẩn- góc so sánh thay thế
- reCAPTCHA Enterprise so với Standard — Hướng dẫn đầy đủ- bao gồm tất cả các phiên bản
- Cách giải reCAPTCHA v3 bằng API- hướng dẫn v3 tiêu chuẩn
- Cách giải reCAPTCHA v3 Enterprise bằng API- hướng dẫn doanh nghiệp v3
- Giải thích về tham số hành động reCAPTCHA v3— tìm hiểu sâu về tham số hành động
Câu hỏi thường gặp
Việc sử dụng sai cờ doanh nghiệp có gây ra lỗi không?
Thường thì có. Các trang web sử dụng mã thông báo xác minh Doanh nghiệp dựa trên API doanh nghiệp, dự kiến sẽ có mã thông báo Doanh nghiệp. Mã thông báo tiêu chuẩn có thể không xác minh được và ngược lại.
Làm cách nào để phát hiện Enterprise v3 theo chương trình?
Tìm kiếm nguồn trang cho enterprise.js:
page_source = driver.page_source
is_enterprise = "enterprise.js" in page_source
Có sự khác biệt về hiệu suất?
Không. Thời gian giải và tỷ lệ thành công của cả hai phiên bản là tương tự nhau.