Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
How can I grab all selectors that are similar to a string in Puppeteer?

I have a selector that only changes in the last character. I want to grab all the selectors that match the beginning. Here is an example of what I am trying to grab:

"button_selector_[number that changes depending on which button]"

In something like grok, I could use * to denote that the text that would be where that character is doesn't really matter. Does javascript have something similar?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To get all elements with an id starting with button_selector_ do:

var ... = document.querySelectorAll('[id^="button_selector_"]');

And similar for all elements with a class:

var ... = document.querySelectorAll('[class^="button_selector_"]');

Documentation: Substring matching attribute selectors

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda