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

202
Views
¿Cómo configurar texto interno por ElementHandle con Titiritero?

Estoy tratando de configurar el innerText de un elemento HTML en un entorno de prueba de Titiritero y no puedo (fácilmente) obtener el elemento mediante el selector de CSS, por lo que obtengo el elementHandle a través de:

 let [ el ] = await page.$x(`//span[contains(text(), 'addTestFile.pdf')]`)

Normalmente configuro innerText para fines de prueba usando evaluate , pero necesito un selector para eso, por ejemplo:

 await page.evaluate(() => document.querySelector('mySelector').innerText = '⚠️DOM modified for testing purposes⚠️')

¿Puedo configurar innerText de un identificador de elemento dado sin un elementHandle de CSS?

Veo que puedo obtener el valor con await el.getProperty('innerHTML') pero no encuentro la manera de configurarlo.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Lo descubrí: puedo usar evaluate en elementHandle así:

 let [ el ] = await page.$x(`//span[contains(text(), 'addTestFile.pdf')]`) await el.evaluate(element => element.innerText = '⚠️DOM modified for testing purposes⚠️')
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!