How to loop through multiple images in Puppeteer

Viewed 18

I am trying to loop through images in a Facebook post, but I am not quite sure how to extract the images while I'm looping, any idea how I can fix this? Thank you


(async()=>{

    const browser = await puppeteer.launch({
        headless: false,
        defaultViewport: false
    });

    const page = await browser.newPage();
    const url = `https://www.facebook.com/groups/133096796703382/permalink/5785155774830761/`;
    await page.goto(url, {"waitUntil": "networkidle2"});
    const images = await page.evaluate(()=>{

        Array.from(
            document.querySelectorAll('div[class="l9j0dhe7"] > img')
        )
    })

})();```
0 Answers
Related