Skip to content

Instantly share code, notes, and snippets.

@enderphan94
Created December 12, 2023 01:39
Show Gist options
  • Save enderphan94/9b5aa70a4c470af306651d25669063e9 to your computer and use it in GitHub Desktop.
Save enderphan94/9b5aa70a4c470af306651d25669063e9 to your computer and use it in GitHub Desktop.
Extract all libraries of a website
//npm install puppeteer
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: "new" });
const page = await browser.newPage();
await page.goto('https://www.pikakasino.com/', { timeout: 60000 }); // 60 seconds
// Injecting and executing your JavaScript code in the page context
const libraries = await page.evaluate(() => {
var entries = performance.getEntriesByType('resource');
return entries
.filter(entry => entry.initiatorType === 'script')
.map(entry => entry.name);
});
console.log(libraries);
await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment