I would like to fetch and extract a string that is between tags. Using only JavaScript with Node.
Example: Extract information inside any tag and save to some variable.
I'm not sure how to implement code for this. I do not know if I could be clear.
Example2 is what I'm trying to do. Search and save the names of teachers on this page. I noticed that everyone is among the header2 tags ...
const url = 'http://www.ppg-educacao.uff.br/novo/index.php/corpo-docente'
const axios = require('axios')
axios.get(url).then(response =>{
const funcionarios = response.data
console.log(funcionarios) //Somente para verificar as informações da página foram extraidas.
//Eu gostaria de salvar o nome de todos os professores, e percebi que todos estão entre a tag <h2>...
const tag = funcionarios.querySelector("h2")
const conteudoDeTextoDaTag = tag.textContent
console.log(conteudoDeTextoDaTag)
});