Custom Cookies
If you would like to send custom cookies to the target website, simply add them as parameters to the request or as the “Wsa-Cookie” header (see Custom-Headers section).
In the right-side box, you will find an example request used to scrape the URL https://httpbin.org/cookies, which will mirror the cookies sent.
Custom Cookies examples
GET https://scrape.shifter.io/v1?api_key=api_key&url=http%3A%2F%2Fhttpbin.org%2Fcookies
⇡ Input
curl --request GET --url "https://scrape.shifter.io/v1?api_key=api_key&url=http%3A%2F%2Fhttpbin.org%2Fcookies" --header "Wsa-Accept: application/json" --header "Wsa-Cookie: name1=value1; name2=value2"const http = require("https");
const options = {
"method": "GET",
"hostname": "scrape.shifter.io",
"port": null,
"path": "/v1?api_key=api_key&url=http%3A%2F%2Fhttpbin.org%2Fcookies",
"headers": {
"Wsa-Accept": "application/json",
"Wsa-Cookie": "name1=value1; name2=value2"
}
};
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();⇣ Output
{
"cookies": {
"name1": "value1",
"name2": "value2"
}
}Last updated
Was this helpful?