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

224
Views
How can I extract the link from a specific class?
<td class="views-field views-field-title">
  <a href="xxxxxxx" class="cat-job-rate recruiter-colorbox-processed">
    xxxxxx
  </a><br>
  <span class="job-label">Organization:</span>
  xxxxx | <span class="job-label">xxxxxx:</span>
  xxxx | <span class="job-label">xxxx:</span> xxxxx
</td>

I want to extract a link from a webpage using cheerio from the class="views-field views-field-title". There are so many a links on the webpage but I want to extract from the mentioned class only.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As per HTML snippet you shared, below snippet will able to retrieve all the hyperlinks.

<!DOCTYPE html>
<html>
<head>
    <script>
    function getHyperlinks() {
        var parent = document.querySelectorAll(".views-field.views-field-title > a");
        for(let i = 0; i < parent.length; i++) {
            console.log(parent[i].getAttribute("href"))
        }
    }
    </script>
</head>

<body>
    <h2>My First JavaScript</h2>
    <table>
        <td class="views-field views-field-title"> <a href="xxxxxxx" class="cat-job-rate recruiter-colorbox-processed">xxxxxx</a>
            <br><span class="job-label">Organization:</span> xxxxx | <span class="job-label">xxxxxx:</span>xxxx | <span class="job-label">xxxx:</span> xxxxx </td>
    </table>
    <input type="button" onclick="getHyperlinks();" value="click" /> </body>

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