<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ProxyZen Blog]]></title><description><![CDATA[ProxyZen Blog]]></description><link>https://proxyzen.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 22:40:27 GMT</lastBuildDate><atom:link href="https://proxyzen.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Proxy in Puppeteer, Playwright, Selenium and curl: code examples]]></title><description><![CDATA[How to use an HTTP or SOCKS5 proxy with login and password in Puppeteer, Playwright, Selenium and curl, with code examples and common errors.]]></description><link>https://proxyzen.hashnode.dev/proxy-in-puppeteer-playwright-selenium-and-curl-code-examples</link><guid isPermaLink="true">https://proxyzen.hashnode.dev/proxy-in-puppeteer-playwright-selenium-and-curl-code-examples</guid><category><![CDATA[puppeteer]]></category><category><![CDATA[web scraping]]></category><category><![CDATA[playwright]]></category><dc:creator><![CDATA[ProxyZen]]></dc:creator><pubDate>Sun, 29 Nov 2026 01:38:43 GMT</pubDate><content:encoded><![CDATA[<p>Ready-made examples for browser automation and the command line. In the examples, <code>HOST</code>, <code>PORT</code>, <code>USER</code> and <code>PASS</code> are the data from “My proxies” in the ProxyZen dashboard. Every ProxyZen IPv4 and IPv6 proxy supports <strong>HTTP and SOCKS5</strong>.</p>
<h2>curl</h2>
<pre><code># HTTP proxy
curl -x http://USER:PASS@HOST:PORT https://api.ipify.org

# SOCKS5, DNS resolved on the proxy side
curl -x socks5h://USER:PASS@HOST:PORT https://api.ipify.org

# login and password separately
curl -x http://HOST:PORT -U USER:PASS https://api.ipify.org
</code></pre>
<p><code>socks5h</code> instead of <code>socks5</code> means website names are resolved by the proxy, not by your computer. If the password contains special characters (<code>@</code>, <code>:</code>, <code>#</code>), URL-encode them or pass them with <code>-U</code>.</p>
<h2>Puppeteer (Node.js)</h2>
<p>Chrome does not accept a password in <code>--proxy-server</code>, so the login is passed with <code>page.authenticate</code>:</p>
<pre><code class="language-js">const puppeteer = require('puppeteer');

const browser = await puppeteer.launch({
  args: ['--proxy-server=http://HOST:PORT'],
});
const page = await browser.newPage();
await page.authenticate({ username: 'USER', password: 'PASS' });
await page.goto('https://api.ipify.org');
console.log(await page.evaluate(() =&gt; document.body.innerText));
await browser.close();
</code></pre>
<p>For SOCKS5 with a password in Chrome, use an HTTP proxy instead: Chrome does not support SOCKS5 authentication.</p>
<h2>Playwright (Node.js and Python)</h2>
<p>Playwright accepts the login and password directly:</p>
<pre><code class="language-js">const { chromium } = require('playwright');

const browser = await chromium.launch({
  proxy: { server: 'http://HOST:PORT', username: 'USER', password: 'PASS' },
});
const page = await browser.newPage();
await page.goto('https://api.ipify.org');
console.log(await page.textContent('body'));
await browser.close();
</code></pre>
<pre><code class="language-python">from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(proxy={
        "server": "http://HOST:PORT", "username": "USER", "password": "PASS",
    })
    page = browser.new_page()
    page.goto("https://api.ipify.org")
    print(page.inner_text("body"))
    browser.close()
</code></pre>
<p>You can also set a different proxy for each context: <code>browser.new_context(proxy={...})</code> — convenient for several accounts in one process.</p>
<h2>Selenium (Python)</h2>
<p>Chrome in Selenium does not support a proxy password by itself. The simplest way is the <code>selenium-wire</code> package:</p>
<pre><code class="language-python">from seleniumwire import webdriver

options = {
    "proxy": {
        "http": "http://USER:PASS@HOST:PORT",
        "https": "http://USER:PASS@HOST:PORT",
    }
}
driver = webdriver.Chrome(seleniumwire_options=options)
driver.get("https://api.ipify.org")
print(driver.find_element("tag name", "body").text)
driver.quit()
</code></pre>
<h2>Scrapy and BeautifulSoup</h2>
<p>BeautifulSoup only parses HTML; the proxy is set in the library that downloads the page (<code>requests</code>, <code>httpx</code>). Examples: <a href="https://proxyzen.net/en/blog/proxy-in-python-nodejs">“How to use proxies in Python and Node.js”</a>. In Scrapy, set <code>request.meta["proxy"] = "http://USER:PASS@HOST:PORT"</code>.</p>
<h2>Common errors</h2>
<ul>
<li><strong>407 Proxy Authentication Required</strong> — login or password not passed. See <a href="https://proxyzen.net/en/blog/proxy-requires-username-password">this guide</a>.</li>
<li><strong>ERR_NO_SUPPORTED_PROXIES</strong> in Chrome — SOCKS5 with a password. Use HTTP.</li>
<li><strong>Timeouts</strong> — check the proxy in the <a href="https://proxyzen.net/en/tools/proxy-checker">proxy checker</a> and the port in the <a href="https://proxyzen.net/en/tools/port-check">port check</a>.</li>
<li><strong>403 and CAPTCHAs</strong> — too many requests from one IP. See <a href="https://proxyzen.net/en/blog/proxies-for-web-scraping">“Proxies for web scraping”</a>.</li>
</ul>
<p>Proxies can also be bought and renewed automatically through the <a href="https://proxyzen.net/en/api">ProxyZen API</a>. Private IPv4 from <strong>$0.60</strong>, residential from <strong>$1.59</strong> per GB. <a href="https://proxyzen.net/cabinet/buy">Buy proxies</a>.</p>
<p><em>Originally published on the <a href="https://proxyzen.net/en/blog/proxy-puppeteer-playwright-curl">ProxyZen blog</a>.</em></p>
]]></content:encoded></item></channel></rss>