Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda