Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
463 B
1
Indexable
Never
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://www.instagram.com/<username>');
  await page.waitForSelector('img._6q-tv');
  const imgUrl = await page.$eval('img._6q-tv', img => img.src);
  browser.close();

  // Download the image using wget or curl
  const exec = require('child_process').exec;
  exec(`wget ${imgUrl}`);
})();