I this is part of the first node web scraper I created with axios and cheerio. I took out all of the logic, since I only wanted to showcase how a basic setup for a nodejs web scraper would look.
const cheerio = require('cheerio'),
axios = require('axios'),
url = `<url goes here>`;
axios.get(url)
.then((response) => {
let $ = cheerio.load(response.data);
$('a').each(function (i, e) {
let links = $(e).attr('href');
console.log(links);
})
}).catch(function (e) {
console.log(e);
});
k