Skip to content

Instantly share code, notes, and snippets.

@twhite96
Created August 29, 2023 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twhite96/38b2c534dcd1a62ad405de2990dcbb9c to your computer and use it in GitHub Desktop.
Save twhite96/38b2c534dcd1a62ad405de2990dcbb9c to your computer and use it in GitHub Desktop.
Failed puppeteer scraper
const puppeteer = require('puppeteer');
require('dotenv').config()
async function main() {
const browser = await puppeteer.launch({
headless: true,
args: [`--proxy-server=http://scraperapi:${process.env.SCRAPER_API_KEY}@proxy-server.scraperapi.com:8001`]
});
const page = await browser.newPage();
await page.goto('https://whatismyipaddress.com/');
await page.pdf({ path: 'program.pdf' });
await browser.close();
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment