Skip to content

Instantly share code, notes, and snippets.

@arvidkahl
Created March 26, 2021 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arvidkahl/d3cece1cc953fe2e8aeca1ed2c97a734 to your computer and use it in GitHub Desktop.
Save arvidkahl/d3cece1cc953fe2e8aeca1ed2c97a734 to your computer and use it in GitHub Desktop.
How to grab a high-res Tweet using Puppeteer
// using https://try-puppeteer.appspot.com/
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({width: 1500, height: 3000, deviceScaleFactor: 4});
await page.goto('https://twitter.com/arvidkahl/status/1375476092853743621?s=20');
await page.waitForNavigation({ waitUntil: 'networkidle2' })
console.log(await page.content());
await page.screenshot({path: 'screenshot.png'});
await browser.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment