-
-
Save omisolaidowu/eeb7b98b1fd22580b6813f0512296044 to your computer and use it in GitHub Desktop.
Full script
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
// import the required libraries | |
const puppeteer = require('puppeteer-extra'); | |
const StealthPlugin = require('puppeteer-extra-plugin-stealth'); | |
// tie Puppeteer Extra to the Stealth plugin | |
puppeteer.use(StealthPlugin()); | |
(async () => { | |
// run puppeteer in non-headless mode | |
const browser = await puppeteer.launch({ headless: false }); | |
const page = await browser.newPage(); | |
// patch navigator.platform | |
await page.evaluateOnNewDocument(() => { | |
// redefine navigator.platform for macOS | |
Object.defineProperty(navigator, 'platform', { | |
value: 'MacIntel', | |
}); | |
}); | |
// visit CreepJS | |
await page.goto('https://abrahamjuliot.github.io/creepjs/'); | |
// use setTimeout to wait for the page to load | |
await new Promise(resolve => setTimeout(resolve, 100000)); | |
await browser.close(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment