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

223
Views
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
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!