Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
TimeoutError: Timeout exceeded while waiting for event after click on button in autotest

Registration on the site consists of three stages. The first step is to provide a name, email address. When you submit the form of the first step, you are redirected to the second step (confirmation by email). The URL changes in the browser, and confirmation email sends to the mail. For implement the autotest, we decided that we would always register the same email address. For confirmation in the request for this email you will receive a confirmation link. Sample code below.

await page.click(btnSignUp)
const [response] = await Promise.all([
   page.waitForResponse((response) =>response.url()===apiURL+'/register'), 
   {timeout: 30 * 1000}
])
const responseData = await response.json()

After clicking on the "Register" button, I see the following page (confirm email), but I cannot get a response to the request. I see the response in the terminal when performing an autotest. But I got the error "TimeoutError: Timeout exceeded while waiting for event" What is the problem, help me figure it out, please.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I am attaching code snippet. You can use that and modify according to your scenario. It helps in dealing with timeout error related issues.

const puppeteer = require("puppeteer");
const { scrollPageToBottom } = require('puppeteer-autoscroll-down')

async function scrape () {

const browser = await puppeteer.launch({headless: false});
const page =  await browser.newPage();

await page.goto("https://twitter.com/elonmusk", {waitUntil: "networkidle2"});

let isLoadingAvailable = true // Your condition-to-stop

while (isLoadingAvailable) {
    try{
        await scrollPageToBottom(page, { size: 250 , delay: 500})
        await page.waitForResponse(
        response => response.url() === 'https://twitter.com/elonmusk' && response.status() === 200
        )

    } catch (ex) {
        continue;
        
    }
    isLoadingAvailable = false // Update your condition-to-stop value
}

console.log("Loading done")
await browser.close();
};
scrape();
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda