User agent randomized
This commit is contained in:
parent
b97b10975d
commit
affb54155c
@ -1,5 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"puppeteer": "^14.4.0"
|
||||
"puppeteer": "~19.5.2",
|
||||
"user-agents": "~1.0.1260"
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
// npm install https://github.com/GoogleChrome/puppeteer/
|
||||
|
||||
const puppeteer = require('puppeteer');
|
||||
const userAgent = require('user-agents');
|
||||
|
||||
(async () => {
|
||||
|
||||
const url = process.argv[2];
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.setUserAgent(userAgent.random().toString());
|
||||
|
||||
await page.goto(url, {waitUntil: 'load'});
|
||||
|
||||
|
Reference in New Issue
Block a user