Forcing Timeouts
Forcing Timeouts examples
curl --request GET --url "https://scrape.shifter.io/v1?api_key=api_key&url=https%3A%2F%2Fhttpbin.org%2Fget&render_js=1&timeout=200"const http = require("https");
const options = {
"method": "GET",
"hostname": "scrape.shifter.io",
"port": null,
"path": "/v1?api_key=api_key&url=https%3A%2F%2Fhttpbin.org%2Fget&render_js=1&timeout=200",
"headers": {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();{
"status": "Failure",
"status_code": 422,
"created_at": "2022-04-26T11:57:23.242Z",
"processed_at": "2022-04-26T11:57:23.739Z",
"time_taken": {
"total": 0.701,
"scraping": 0.202,
"setup_worker": 0.403
},
"error": "The target page took more than 0.2 seconds to load, the website might be down. Retry the request or increase the value of 'timeout' parameter.",
"page_content": null
}Last updated
Was this helpful?