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

181
Views
Obtener un atributo de datos con DomCrawler

¿Es posible obtener los datos con DomCrawler?

$cralwer->attr('class') me obtiene el atributo de clase del nodo, pero ->attr('data-something') o ->attr('something') siempre da como resultado null .

Editar: etiquetar PHP también porque lo intenté mientras manipulaba el objeto DomElement desde php (usando ->attributes->getNamedItem() ) y aún no funciona. Me pregunto si no es posible devolver un atributo de datos.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Entiendo. El atributo de datos en el código fuente se escribió como tal: data-SomeAttribute .

Intentar acceder a él con los casos ( $crawler->attr('data-SomeAttribute' ) es lo que está fallando aquí. ¡Hacerlo sin el caso ( $crawler->attr('data-someattribute' ) funciona perfectamente bien!

about 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!