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

182
Vistas
get className of a reusable component from html

I'm doing a web scraping project an ineeded to scrape this site for test : https://quotes.toscrape.com/js/

The HTML:
<div class="quote" itemscope itemtype="http://schema.org/CreativeWork">
    <span class="text" itemprop="text">“The world as we have created it is a process of our thinking. It cannot be changed without changing our thinking.”</span>
    <span>by <small class="author" itemprop="author">Albert Einstein</small>
    <a href="/author/Albert-Einstein">(about)</a>
    </span>
    <div class="tags">
        Tags:
        <meta class="keywords" itemprop="keywords" content="change,deep-thoughts,thinking,world" /    > 
        
        <a class="tag" href="/tag/change/page/1/">change</a>
        
        <a class="tag" href="/tag/deep-thoughts/page/1/">deep-thoughts</a>
        
        <a class="tag" href="/tag/thinking/page/1/">thinking</a>
        
        <a class="tag" href="/tag/world/page/1/">world</a>
        
    </div>
</div>

<div class="quote" itemscope itemtype="http://schema.org/CreativeWork">
    <span class="text" itemprop="text">“It is our choices, Harry, that show what we truly are, far more than our abilities.”</span>
    <span>by <small class="author" itemprop="author">J.K. Rowling</small>
    <a href="/author/J-K-Rowling">(about)</a>
    </span>
    <div class="tags">
        Tags:
        <meta class="keywords" itemprop="keywords" content="abilities,choices" /    > 
        
        <a class="tag" href="/tag/abilities/page/1/">abilities</a>
        
        <a class="tag" href="/tag/choices/page/1/">choices</a>
        
    </div>
</div>.....

So, there is this reusable component with className quote. My question is, how to auto detected and get the className with js ?

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

0

I have not clearly understand but read about querySelector

in your case:

const element = document.querySelectorAll(".quote")
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