uncertain-scarletU
Apify & Crawlee3y ago
13 replies
uncertain-scarlet

How to launch playwrightcrawler inside basiccrawler?

So i have this code:

const cookieJar = new CookieJar();
export const basicCrawler = new BasicCrawler({
    async requestHandler({ sendRequest, request, log }) {
        try {
            const res = await sendRequest({
                url: request.url,
                method: 'GET',
                cookieJar
            });
            const json = destr(res.body);
             const urls = json.map(v => v.url);
            await playCrawler.run(urls);
        } catch (error) {
            console.log(error);

        }
     
    },
});

//code for playwright crawler here

I start the crawler by calling the basicCrawler.run(['url']);
The problem is it seems to call the basicCrawler again for the urls i pass to playCrawler. how is that possible?
Was this page helpful?