This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://www.instagram.com/p/B3UZAnJHCOX/'); | |
await page.content() | |
const len = await page.evaluate(() => { | |
len = (document.querySelector('._6CZji .coreSpriteRightChevron')) ? document.querySelectorAll('div.tN4sQ li._-1_m6').length : 1 | |
return Promise.resolve(len); | |
}); |