How to set cookie on Crawlee?
I want to set cookie on PlaywrightCrawler, but I can't find the tutorial on the documentation.


BrowserControllerBrowserControllerPuppeteerControllerPuppeteerControllerPlaywrightControllerPlaywrightControllerpreNavigationHookspostNavigationHookspostNavigationHookspreNavigatioNHooks preNavigationHooks: [
async (context) => {
const url = context.request.url;
const cookie = context.request.headers['cookie'];
context.log.info(`pre-nav: cookie is '${cookie}'`);
}],
postNavigationHooks: [
async (context) => {
const url = context.request.url;
const cookie = context.request.headers['cookie'];
context.log.info(`post-nav: cookie is '${cookie}'`);
}],const crawler = new PlaywrightCrawler({
preNavigationHooks: [
async (crawlingContext, gotoOptions) => {
await crawlingContext.page.context().addCookies([{
name: 'hasConsented',
value: '1',
domain: 'www.blabla.com',
path: '/',
}])
},
],
})