Overview#
Scrapeless Scraping Browser extends the standard CDP (Chrome DevTools Protocol) functionality with a series of powerful custom functions to enhance browser automation capabilities. This documentation covers CDP functions for CAPTCHA handling, Signal communication, and Agent operations.
Captcha API#
Overview#
Scrapeless Scraping Browser includes advanced CAPTCHA solution capabilities that can automatically handle mainstream CAPTCHA types appearing on web pages.Events#
Scraping Browser provides three core events to monitor the CAPTCHA solving process:| Event Name | Description |
|---|
Captcha.detected | CAPTCHA detected |
Captcha.solveFinished | CAPTCHA solved |
Captcha.solveFailed | CAPTCHA solve failed |
Event Response Data Structure:| Field | Type | Description |
|---|
type | string | CAPTCHA type: recaptcha turnstile |
success | boolean | Solution result |
message | string | Status message: "NOT_DETECTED" "SOLVE_FINISHED" "SOLVE_FAILED" "INVALID" |
token? | string | Token returned on success (optional) |
Methods#
| Method | Description |
|---|
Captcha.setToken | Set authentication token for CAPTCHA service |
Captcha.setConfig | Configure all CAPTCHA solver parameters |
Captcha.solve | Manually trigger CAPTCHA solving process |
Captcha.setToken#
Set authentication token for CAPTCHA solving service.Captcha.setConfig#
Configure all parameters for the CAPTCHA solver.Captcha.solve#
Manually trigger CAPTCHA solving process.
Signal API#
Overview#
Signal API provides bidirectional communication capabilities for browser automation scripts, enabling real-time data exchange and event coordination through CDP protocol.Bidirectional Communication: Send and receive signals through event channels
Timeout Control: Configurable wait timeout (1s ~ 5min)
Global Sharing: All events are globally visible, no session isolation
Event Queue: First-send-then-wait pattern, supports event caching (up to 100 events)
| Status Code | Meaning | Scenario |
|---|
| 200 | Success | Operation successful or data received |
| 400 | Parameter Error | Parameter validation failed |
| 408 | Timeout | Wait timeout, no data received |
| 500 | Server Error | Internal exception |
Methods#
| Method | Description |
|---|
Signal.send | Send data to specified event channel |
Signal.wait | Wait for data from specified event channel |
Signal.list | List pending event names |
Signal.stats | View queue statistics |
Signal.clear | Clear specified or all events |
Signal.send#
Send signal data to a specified event channel.| Parameter | Type | Required | Description |
|---|
event | string | ✅ | Event channel name (1-256 characters) |
data | object | ✅ | Event data payload |
Example 1: Send MFA verification codeExample 2: Send CAPTCHA result{
"status": 400,
"error": "event must not be empty"
}
Signal.wait#
Wait for signal data from a specified event channel.| Parameter | Type | Required | Default | Description |
|---|
event | string | ✅ | - | Event channel name |
timeout | integer | ❌ | 60000 | Timeout in milliseconds (1000-300000) |
Example 1: Wait for MFA code (default timeout)Example 2: Wait for CAPTCHA (custom timeout 30 seconds){
"status": 200,
"data": { "code": "123456" },
"event": "mfa_code"
}
Timeout (no data received):{
"status": 408,
"data": null,
"event": "mfa_code"
}
{
"status": 400,
"error": "timeout must be between 1000 and 300000"
}
Signal.list#
List pending event names in the queue.{
"status": 200,
"events": ["mfa_code", "captcha_result", "order_status"]
}
Returns an array of all pending event names
Deduplicated unique event names
Sorted by first occurrence time
Signal.stats#
{
"status": 200,
"events": 12,
"waiters": 3
}
| Field | Type | Description |
|---|
status | integer | Status code (200) |
events | integer | Total number of pending events in queue |
waiters | integer | Number of waiting subscribers |
Signal.clear#
Clear specified or all events.| Parameter | Type | Required | Description |
|---|
event | string | ❌ | Event name, omit to clear all events |
{
"status": 200,
"cleared": 5
}
| Field | Type | Description |
|---|
status | integer | Status code (200) |
cleared | integer | Number of events cleared |
Agent API#
Overview#
Agent API provides browser automation utilities for simulating user interactions and retrieving page information.Methods#
| Method | Description |
|---|
Agent.click | Simulate a mouse click |
Agent.liveURL | Get live URL of current session page |
Agent.click#
Agent.liveURL#
Get live URL of current session page.Modified at 2025-11-26 10:06:39