Puppeteer配置代理失败,抛出ERR_NO_SUPPORTED_PROXIES错误怎么办?
Fixing Puppeteer Proxy
ERR_NO_SUPPORTED_PROXIES Error Hey there, let's get your Puppeteer proxy working properly. That ERR_NO_SUPPORTED_PROXIES error is popping up because Chrome (the engine behind Puppeteer) no longer supports embedding your proxy username and password directly in the --proxy-server command line argument. Here's how to fix this:
Step 1: Update the Proxy Server Argument
First, remove the username and password from the --proxy-server value—only keep the proxy host and port:
args: [ '--proxy-server=http://zproxy.luminati.io:22225' ]
Step 2: Add Proxy Authentication Separately
Use Puppeteer's page.authenticate() method to pass your proxy credentials before navigating to any page. This is the official supported way to handle proxy auth now.
Here's your revised full code:
(async () => { const browser = await puppeteer.launch({ headless: false, args: [ '--proxy-server=http://zproxy.luminati.io:22225' ] }); const page = await browser.newPage(); // Authenticate with the proxy await page.authenticate({ username: 'your-actual-username', password: 'your-actual-password' }); await page.goto('https://www.whatismyip.com/'); await page.screenshot({ path: 'example.png' }); // await browser.close(); })();
Additional Troubleshooting Tips
- Double-check that your proxy service (Luminati in this case) is active and the host/port/username/password are all correct—typos are a common culprit!
- If you're using a SOCKS proxy instead of HTTP, change the protocol in
--proxy-servertosocks5://(e.g.,socks5://zproxy.luminati.io:22225). - Test the proxy manually in a regular Chrome browser first to confirm it can access
whatismyip.comwithout issues—this helps rule out problems with the proxy itself.
内容的提问来源于stack exchange,提问作者Jatt




