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

397
Views
¿Cómo en Playwright obtener datos de evaluación de argumentos?

¿Cómo en Playwright obtener datos de evaluación de argumentos? page.evaluate: ReferenceError: d no está definido

 async function testEv(d) { const data = await this.page.evaluate(function() { console.log('d from args is', d) }) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tienes que pasar a la función de evaluate una función que espera un argumento. Para evitar la confusión, llamémoslo c , y luego pase d como segundo argumento a la evaluate .

 async function testEv(d) { const data = await this.page.evaluate((c) { console.log('d from args is', c) }, d) }

Si necesita pasar más de un argumento, puede pasar un objeto

 async function testEv(d) { const data = await this.page.evaluate((obj) { console.log('obj.foo from args is', obj.foo); console.log('obj.bar from args is', obj.bar); }, { foo: d, bar: d, }) }
about 4 years ago · Juan Pablo Isaza Report
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!