JS Render Docs
Basic Request Structure
{
"actor": "unlocker.webunlocker",
"input": {
"url": "https://example.com",
"js_render": false,
"headless": false
},
"proxy": {
"country": "US"
}
}
Core Features
JavaScript Rendering
js_render=true
,we will use the browser to request.{
"actor": "unlocker.webunlocker",
"input": {
"url": "https://www.google.com/",
"js_render": true
},
"proxy": {
"country": "US"
}
}
JavaScript Instructions
{
"actor": "unlocker.webunlocker",
"input": {
"url": "https://example.com",
"js_render": true,
"js_instructions": [
{
"wait_for": [
".dynamic-content",
30000
]
// Wait for element
},
{
"click": [
"#load-more",
1000
]
// Click element
},
{
"fill": [
"#search-input",
"search term"
]
// Fill form
},
{
"keyboard": [
"press",
"Enter"
]
// Simulate key press
},
{
"evaluate": "window.scrollTo(0, document.body.scrollHeight)"
// Execute custom JS
}
]
}
}
Instruction | Syntax | Description | Example |
---|---|---|---|
wait_for | [selector, timeout] | Wait for element to appear | {"wait_for": [".content", 30000]} |
click | [selector, delay] | Click element | {"click": [".button", 1000]} |
fill | [selector, value] | Fill form | {"fill": ["#input", "text"]} |
wait | milliseconds | Fixed wait time | {"wait": 2000} |
evaluate | javascript_code | Execute JS code | {"evaluate": "console.log('test')"} |
keyboard | [action, value, delay?] | Keyboard operation | See keyboard operations table below |
Operation | Syntax | Description | Example |
---|---|---|---|
Press key | ["press", keyInput] | Press a specific keyInput | {"keyboard": ["press", "Enter"]} |
Type text | ["type", text, delay?] | Type text with optional delay | {"keyboard": ["type", "Hello", 20]} |
Key down | ["down", key] | Hold down a key | {"keyboard": ["down", "Shift"]} |
Key up | ["up", key] | Release a key | {"keyboard": ["up", "Shift"]} |
https://pptr.dev/api/puppeteer.keyinput
Resource Control
{
"actor": "unlocker.webunlocker",
"input": {
"url": "https://example.com",
"js_render": true,
"block": {
"resources": [
"Image",
"Font",
"Stylesheet",
"Script"
],
"urls": [
// Optional, URL pattern-based blocking
"*.analytics.com/*",
"*/ads/*"
]
}
}
}
Resource Type | Description | Impact |
---|---|---|
Document | Main document and iframes | Core page content |
Stylesheet | CSS files | Page styling and layout |
Image | Images and icons | Visual content |
Media | Audio and video resources | Multimedia content |
Font | Web fonts | Text rendering |
Script | JavaScript files | Page functionality |
TextTrack | Video subtitles and captions | Media accessibility |
XHR | XMLHttpRequest calls | Legacy async requests |
Fetch | Fetch API requests | Modern async requests |
Prefetch | Prefetched resources | Performance optimization |
EventSource | Server-sent events | Real-time updates |
WebSocket | WebSocket connections | Bidirectional communication |
Manifest | Web app manifests | PWA configuration |
SignedExchange | Signed HTTP exchanges | Content authenticity |
Ping | Ping requests | Analytics and tracking |
CSPViolationReport | CSP violation reports | Security monitoring |
Preflight | CORS preflight requests | Cross-origin security |
Other | Unclassified resources | Miscellaneous |
{
"actor": "unlocker.webunlocker",
"input": {
"url": "https://example.com",
"js_render": true,
"block": {
"resources": [
"Image",
"Font",
"Stylesheet",
"Script",
"Media",
"Ping",
"Prefetch"
]
}
}
}
1.
js_render
only when necessaryPrefetch
and Ping
for reduced network usageDocument
and critical Script
resources unblocked2.
Image
and Media
for bandwidth-intensive pagesFont
to use system fonts instead3.
wait_for
instead of fixed wait
4.
Modified at 2025-01-07 10:51:01