Skip to content

Instantly share code, notes, and snippets.

View ng9891's full-sized avatar

David - vT ng9891

  • New York
View GitHub Profile
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);
});