codemanki / cloudscraper

--DEPRECATED -- 🛑 🛑 Node.js library to bypass cloudflare's anti-ddos page
MIT License
602 stars 139 forks source link

Getting cloudflare cookies after request is complete #299

Closed TadaWasRaped closed 4 years ago

TadaWasRaped commented 4 years ago

Is there a way to get the cloudflare cookies after doing a request? Can't seem to find anything, might be me being retarded

codemanki commented 4 years ago

@TadaWasRaped You need to first create a custom jar, pass it to the request and after it was made, read from the jar:

https://github.com/codemanki/cloudscraper/blob/master/docs/examples/session-persistence.js#L9

codemanki commented 4 years ago

Something like this:

let jar = cloudscraper.jar();
cloudscraper = cloudscraper.defaults({ jar});
cloudscraper.get(uri).then(() => console.log(jar));