Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mkdir hardump
- cd hardump
- npm i puppeteer-har --save
- #######CODE#########
- const puppeteer = require('puppeteer');
- const PuppeteerHar = require('puppeteer-har');
- const url = process.argv[2];
- if (!url) {
- throw "Please provide URL as a first argument";
- }
- (async () => {
- const browser = await puppeteer.launch({headless: 'new'});
- const page = await browser.newPage();
- const har = new PuppeteerHar(page);
- await har.start({ path: 'results.har' });
- await page.goto(url);
- await har.stop();
- await browser.close();
- })();
- #####RUN######
- node har.js "https://filmsbykris.com/"
- cat results.har|jq .l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement