I'm setting up Facebook Scraper with puppeteer but I have checked this code in Chrome console and it works.
I have listed the class, I need to get the id of the class I have listed.
Did you try the following?
let post_id = await postElement.evaluate(() => {
return {
document.querySelector('div[class="_5pcb _4b01 _2q8l"]').id,
}
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.