#Add cookie in a special request
1 messages · Page 1 of 1 (latest)
1 messages · Page 1 of 1 (latest)
I want to add cookie to special ajax url in pupperties:
page.on('request', async (req) => {
await req.continue(); // if you don't call this, it will hang indefinitely
});
How to add?
import { PuppeteerCrawler } from 'crawlee';
const crawler = new PuppeteerCrawler({
preNavigationHooks: [
async ({ page }) => {
page.on('request', async (req) => {
req.continue({ headers: { Cookie: 'abc' } });
});
},
],
});
Thank you