ltd-scarletL
Apify & Crawleeβ€’4y agoβ€’
2 replies
ltd-scarlet

Setting a cookie in Cheerio before the page request

I am trying to use Cheerio to crawl a site that authenticates via session-based cookies. I have the cookie value I want to set, but don't know where/how to set it so every page request of my Actor's run has that cookie set.

Are there pre-request callbacks I can use in Cheerio to set a cookie, or perhaps a high-level per-Actor config I can set cookie values that will persist across all sessions?

I can't find any examples or documentation for how to access the session/sessionPool not already within a Cheerio requestHandler πŸ€·πŸ»β€β™‚οΈ

Thank you!
Was this page helpful?