dry-scarletD
Apify & Crawlee4y ago
4 replies
dry-scarlet

Use page.on('request') in PuppeteerCrawler

How can i do that with the PuppeteerCrawler?

page.on('request', async (request) => {
        // check if request.url contains any of the google domains
        googleDomains.forEach((domain) => {
          // if domain is found in the request.url push the url to the foundObjects.foundDomains array
          if (request.url().includes(domain)) {
            // show spinner info
            found.foundDomains.push(request.url());
            takeScreenshot = true;
          }
        });
      });
Was this page helpful?