#Add cookie in a special request

1 messages · Page 1 of 1 (latest)

trail harbor
#

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?

novel atlas
#
import { PuppeteerCrawler } from 'crawlee';

const crawler = new PuppeteerCrawler({
    preNavigationHooks: [
        async ({ page }) => {
            page.on('request', async (req) => {
                req.continue({ headers: { Cookie: 'abc' } });
            });
        },
    ],
});
trail harbor
#

Thank you