I have made a web scraping script in Node JS using Puppeteer and Cheerio. It works alright so far, but my issue now is that is want to be able to interact (click) with an element that i have found with cheerio.
I have tried extracting the xpath and other issues, but it did not seem to work.
I have tried returning the entire query selector but with no luck. When i try to use the same syntax from cheerio into a single query selector using puppeteer it fails....
puppeteer.launch({headless: false})
.then(async (browser) =>{
let page = await browser.newPage();
page.goto(providerUrl)
.then(async () =>{
const content = page.content();
content.then(success =>{
const $ = cheerio.load(success);
const wrapperChildren = $('.providerCardOut > div').children()
wrapperChildren.each(async (index, elem) =>{
//how to click this element, when it is found.
const clickableButton = $(elem).find('.providerCard-spoiler-title providerCard-closed')
})
})
})