Integrations / Browser automation
Use Proxys with Playwright
Run Playwright browsers through Proxys. Use one sticky session per browser context.
Steps
- Pass server, username and password in the proxy option.
- Add -session-<id> to keep one IP for a whole browsing session.
const browser = await chromium.launch({
proxy: { server: "http://gw.proxys.co:8000", username: "USERNAME-country-us-session-s1", password: "PASSWORD" },
});
const page = await browser.newPage();
await page.goto("https://ipinfo.io/json");browser = p.chromium.launch(proxy={"server": "http://gw.proxys.co:8000", "username": "USERNAME-country-us-session-s1", "password": "PASSWORD"})Before you start
Replace USERNAME and PASSWORD with a sub-user's credentials from the dashboard. Change -country-us to the country you need, or remove it for a random location. See targeting options for city, ASN and sticky sessions.