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

406
Views
When it is better to use page.type() or page$eval() to input text with Puppeteer?

I am using Puppeteer to insert some text (an email address) into an input field on a web page. By reading online docs and blogs, I found two ways to do it. To input the value "directly" by using:

page.$eval('input[type="email"]', element => element.setAttribute("value", "me@mydomain.com"))

or to input the text as a user would do, by using:

page.keyboard.type("me@mydomain.com")

What are the pros/cons of the two commands? When shall I prefer one over the other?

about 4 years ago · Santiago Trujillo
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!