Puppeteer's page.authenticate() does not work for proxy authorization!
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
const puppeteer = require('puppeteer'); | |
(async() => { | |
const proxyUrl = 'http://proxy.example.com:8000'; | |
const username = 'bob'; | |
const password = 'password123'; | |
const browser = await puppeteer.launch({ | |
args: [`--proxy-server=${proxyUrl}`], | |
headless: false, | |
}); | |
const page = await browser.newPage(); | |
await page.authenticate({ username, password }); | |
await page.goto('https://www.example.com'); | |
await browser.close(); | |
})(); |
It helped me to specify new paths for --user-data-dir =
'--user-data-dir=C:\\Program Files\\nodejs\\newprofile\\profile
+rand(1,1000)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mnmkng Sure, I have deleted it, because I show login and password for all))