Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
Puppeteer wait for navigation causing errors on two of the same websites

I'm having a problem with Puppeteer where I run one set of code and it works fine for a website, but then if I run the same code for another website running the same platform it doesn't work as expected. I'm using the two websites https://www.toyotaofcedarpark.com/ and https://www.toyotaofnaperville.com/ both of which are made with Dealer Inspire

This code works on https://www.toyotaofnaperville.com/ but not https://www.toyotaofcedarpark.com/ (I receive a timeout error)

index.js

var link = await scraperFunctions.getInventoryLink(page, category);
console.log("Found inventory link:", link);
await page.goto(link);
await page.waitForNavigation();
var postedVehicles = await scraperFunctions.postedVehicles(page, category);
console.log(postedVehicles, ": NUM VEHICLES");

postedVehicles.js

async function postedVehicles(page, category) {
  switch (category) {
    case 0:
      return category0(page);
    case 1:
      return category1(page);
    case 2:
      return category2(page);
  }
}
async function category0(page) {
  return await page.$eval("span#results-title", (elem) =>
    elem.innerText.replace(/\D/g, "")
  );
}
module.exports = postedVehicles;

Yet, when I remove the await page.waitForNavigation(); line from index.js it works for https://www.toyotaofcedarpark.com/ but not https://www.toyotaofnaperville.com/ (I receive a Error: Execution context was destroyed, most likely because of a navigation.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!