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

182
Views
How to reload a page using puppeteer(if page doesn't load only)

Most of the time I launch my automated bot it stucks at the beginning due to network issues,so when I reload it,It works.I want my bot to do this if the page doesn't load

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your page request isn't responded or the response isn't success with status 200 OK.
So maybe you want to get the page requested again if the response isn't OK.
These below lines will try to reload the page until it's status is 200 OK.

const gotoHome = async () => {
    try {
        let response
        do {
            response = await page.goto('https://www.google.com', {
                timeout: 0,
                waitUntil: 'load'
            })
        } while (response.status() !== 200)
    } catch (error) {
        (async () => await bot.gotoHome())()
    }
}

Please accept my answer as right if this help you.

about 4 years ago · Juan Pablo Isaza Report
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!