v1
latestOpenAPI 3.0.02026-07-133020.5 KB/scrape-js: scraping with JS rendering
Launches real Chrome browser engine, use only when /scrape endpoint features are not enough.
post/scrape-js
Request body
Example request
{
"url": "https://example.com",
"waitForSelector": "h1.some-class",
"postWaitTime": 5,
"dumpIframe": "icims_content_iframe",
"waitForSelectorIframe": ".iCIMS_PagingBatch",
"extractorTargetIframe": true,
"headers": [
"X-Header: some-random-header"
],
"retryNum": 1,
"geo": "eu",
"proxy": "http://user:pw@host:port",
"timeout": 8,
"textNotExpected": [
"random-captcha-text-which-might-appear"
],
"statusNotExpected": [
403,
429
],
"blockImages": true,
"blockMedia": true,
"screenshot": true,
"viewport": {
"width": 1920,
"height": 1080,
"deviceScaleFactor": 3
},
"extractor": "function(input, cheerio) {\n let $ = cheerio.load(input);\n return $('h1.title').text(); } "
}Response
OK
Example response
{
"info": {
"statusCode": 200,
"finalUrl": "https://example.com/url",
"catchedAjax": {
"url": "https://example.com/api/data.json",
"method": "GET",
"headers": [
"content-type: xxx",
"header2: val2"
],
"body": "<html><body><h1>Hello World!</h1></body></html>",
"bodyIframe": "<html><body><h1>Iframe content</h1></body></html>",
"status": 200,
"responseHeaders": {
"content-type": "application/json"
}
},
"headers": [
"content-type: xxx",
"header2: val2"
]
},
"body": "<html><body><h1>Hello World!</h1></body></html>"
}