Added executable path

This commit is contained in:
2023-07-14 12:07:06 +02:00
parent 93096eb52b
commit 9d33ca744a
3 changed files with 8 additions and 3 deletions

View File

@@ -6,11 +6,12 @@ const userAgent = require('user-agents');
(async () => {
const url = process.argv[2];
const browser = await puppeteer.launch();
const binary = argv[3];
const browser = await puppeteer.launch({ executablePath: binary });
const page = await browser.newPage();
await page.setUserAgent(userAgent.random().toString());
await page.goto(url, {waitUntil: 'load'});
await page.goto(url, { waitUntil: 'load' });
const html = await page.content();