Unable to scrape the link from the element below using cheerio
const outputFile= 'data.json'
const parsedResults =[]
const pagelimit = 50
let pageCounter = 0
let resultCount = 0
const getWebsiteContent = async(url)=>{
try{
const response = await axios.get(url)
const nextPageLink = $('a.btn._def._i._sm', response.data).attr('href');
console.log(nextPageLink);
}
catch(error){
console.error(error)
}
}
getWebsiteContent(url);`
I tried to select the class in the code above by using $('a.btn._def._i._sm', hmtl) but its not working.I keep getting null.
Please has anyone encountered this issue before and how did they solve it?