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

230
Views
¿Cómo puedo seleccionar texto en un elemento que no está dentro de otro elemento?

Tengo un problema con algún selector CSS (solo tengo una forma de encontrar un elemento si uso comandos JS, por lo que solo el selector CSS está disponible para mí) La página se ve así:

 <div class='test'> some_text <span> some_other_text </span> </div>

Y necesito obtener some_text sin obtener "some_other_text"; Traté de usar: By.CssSelector("div[class='test'] :not(span)") >> devuelve todo el texto; By.CssSelector("div[class='test'] span:not(last-child)") >> devuelve solo "some_other_text"; By.CssSelector("div[class='test'] span:not(:last-child)") >> devuelve solo "some_other_text"; By.CssSelector("div[class='test']:not(:last-child)") >> devuelve solo "some_other_text";

hay alguna manera de hacer lo que necesito? ¿alguien podría ayudarme, por favor?

about 4 years ago · Juan Pablo Isaza
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!