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

188
Views
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 answers
Answer question

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