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

319
Visualizações
how can i handle login error in Instagram in node js puppeteer

i want to login multiple accounts one by one on instgram with nodejs puppeteer. so if any account is not login then it should be goes in else statement and move to the new account. but i can't find any solution, can anyone help me ? Thanks in advance

async.eachLimit(User_JSON,1,async(item,cb)=>{
      // Starting browser
  const browser = await puppeteer.launch({headless: false});
  const page = await browser.newPage();
  await page.goto('https://www.instagram.com/accounts/login/?source=auth_switcher');
  await page.waitForSelector('input[name="username"]');
  await page.type('input[name="username"]', "yourusername",{delay:50});
  await page.type('input[name="password"]', "yourpassword",{delay:50});
  await page.click('button[type="submit"]');

 //after submit button i want to handle error of login. if account is successfully login then it working continues and if any account is not logged in then it should be goes in else statement and  print error on console.

// Waiting for page to refresh
  await page.waitForNavigation();
//...remaining code here after login.....
  await browser.close();

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