Created
August 29, 2023 07:29
-
-
Save twhite96/38b2c534dcd1a62ad405de2990dcbb9c to your computer and use it in GitHub Desktop.
Failed puppeteer scraper
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
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