Created
March 26, 2021 16:08
-
-
Save arvidkahl/d3cece1cc953fe2e8aeca1ed2c97a734 to your computer and use it in GitHub Desktop.
How to grab a high-res Tweet using Puppeteer
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
// 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