Skip to content

Commit

Permalink
update extra example
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurav Jain authored and Saurav Jain committed May 29, 2024
1 parent 72ea72c commit 0a39a5b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const crawler = new PuppeteerCrawler({
// The function accepts a single parameter, which is an object with the following fields:
// - request: an instance of the Request class with information such as URL and HTTP method
// - page: Puppeteer's Page object (see https://pptr.dev/#show=api-class-page)
async requestHandler({ request, page, enqueueLinks, log }) {
async requestHandler({ pushData, request, page, enqueueLinks, log }) {
log.info(`Processing ${request.url}...`);

// A function to be evaluated by Puppeteer within the browser context.
Expand All @@ -47,7 +47,7 @@ const crawler = new PuppeteerCrawler({
});

// Store the results to the default dataset.
await crawler.pushData(data);
await pushData(data);

// Find a link to the next page and enqueue it if it exists.
const infos = await enqueueLinks({
Expand Down

0 comments on commit 0a39a5b

Please sign in to comment.