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

228
Visualizações
Signing into Office with Puppeteer not working?

Whenever I try to use Puppeteer to sign into an Office account, it always says to "Enter a valid email address" on the logging in site (and I know the email is valid, I have tested it). I looked through some other questions, and one of them mentioned that they might have login preventions for Puppeteer, Selenium, etc, though I am not sure. I am able to login if I do it manually.

Here's the code that handles all of that:

var email = "myemail@outlook.com"

await page.evaluate((em)=>{
    document.querySelector(`[type="email"]`).value = em;
  },email);

  await page.screenshot({
    path:"./email_input.png"
  })

  await page.waitForTimeout(1000);
  await page.evaluate((em)=>{
    var interval = setInterval(() => {
        if(document.querySelector(`[type="email"]`).value === em){
            document.querySelector(`[type="submit"]`).dispatchEvent(new Event('click'));
            clearInterval(interval);
        }
    });
  },email);

  await page.screenshot({
      path:"./sign_in_email.png"
  })

edit to ManuelMB's comment: It was just a check to make sure that the value was actually the email. It still doesn't work without it.

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