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

266
Views
¿Cómo sacar texto de ElementHandle?

Usando PuppeteerSharp, estoy tratando de obtener el texto del elemento.

 ElementHandle elementHandle = await page.XPathAsync("//html/body/div[1]/section/div/section/h2")[0];

Ahora que tengo el identificador del elemento, ¿cómo obtengo el texto de él? No veo ningún método obvio. Hubiera esperado TextAsync o algo similar, pero no lo veo.

Usando PuppeteerSharp 5.0.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede llamar a EvaluateFunction pasando ese ElementHandle como argumento

 var content = await Page.EvaluateFunctionAsync<string>("e => e.textContent", elementHandle);

Si tiene muchos escenarios como ese, puede crear un método de extensión para resolverlo por usted;)

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