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

232
Vistas
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 Respuestas
Responde la pregunta

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