Integrations · Automation & scraping
Use HProxy with Playwright.
Set an HProxy proxy per browser context in Playwright, no extension needed.
Playwright is Microsoft's modern browser-automation framework, fast, cross-browser, and built with proxy support in the API rather than bolted on.
Playwright can run many isolated browser contexts at once. Give each one its own residential exit and a single script becomes many independent visitors instead of one busy address.
Setting up HProxy in Playwright
- 1.Read your host, port and login from the dashboard.
- 2.Pass a proxy object to launch(), or to newContext() for a different exit per context.
- 3.Playwright handles the authentication handshake itself, so no extra library is required.
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(proxy={
"server": "http://res.hproxy.com:8080",
"username": "user-country-us",
"password": "pass",
})
page = browser.new_page()
page.goto("https://ipinfo.io/json")Worth knowing
Set the proxy on new_context() instead of launch() to give every context a fresh IP from the pool.
Frequently asked questions
Should I set the proxy on launch or on newContext?
On newContext in nearly every case. Setting it at launch applies one proxy to the whole browser, while setting it per context lets each context take a different exit from the proxy pool, which is what makes parallel work with separate identities possible in one browser process.
How do I reduce bandwidth in Playwright?
Route requests and abort the resource types you will not parse. Images, fonts, media and usually stylesheets are the bulk of page weight, and on per-gigabyte residential billing you are paying for every one of them. Blocking them commonly cuts transfer by an order of magnitude while leaving the DOM intact.
Does Playwright get detected more than a real browser?
It drives a real browser engine, so the rendering is genuine. What gives it away is everything around that: the absence of human interaction, request timing that is too regular, and default settings that do not match an ordinary user. Behaviour is the tell far more often than the automation framework itself.
Can I use a sticky session with Playwright?
Yes, and you should for anything holding a login. Request credentials with a sticky length and use them for the whole context, so the exit does not change mid-flow. A fresh address partway through an authenticated sequence reads as a stolen session rather than as a returning visitor.
The host, port and login shown here are the format; your exact values are on your dashboard, ready to copy.