I'm having trouble implementing a code. I've been helped some other time and now I'm needing it again.
The purpose is a script that helps me to remove from an html the name of the teachers and the link from their respective lattes, save somehow for later I handle the data.
I am a beginner in this world and still do not know how to work with jquery, but nothing prevents me from using this option if I am guided.
By analyzing the html code of the page, I could see that the html tag <h2>
is only used for the names of the teachers, so I got the contents of all the headers2 and managed to save. I noticed that after this tag, the next "href" is where the lattes link of the respective teacher ... I'm stuck exactly at that point.
I talked a lot but I think I managed to be clear.
Thank you guys.
const url = 'http://www.ppg-educacao.uff.br/novo/index.php/corpo-docente'
const axios = require('axios')
const cheerio = require('cheerio')
axios.get(url).then(response =>{
const funcionarios = response.data
const $ = cheerio.load(response.data)
const professores = $('h2').text()
console.log($('h2').text())
//const lattes = $('a href="http://lattes.cnpq.br/"' ).text()
//console.log(lattes)
//const informacoes = []
//informacoes.push({'nome ': professores, 'lattes ': lattes})
//console.log (informacoes)
})