Before you start
Nefo provides residential proxies across 227 countries over HTTP, HTTPS, and SOCKS5 with username/password auth. Generate credentials for free in the dashboard proxy generator; only routed traffic consumes your prepaid bandwidth (from 5 GB for $4.50, non-expiring on flexible plans).
Vanilla Selenium struggles with authenticated proxies, so selenium-wire is the recommended path for passing credentials without a manual login popup.
- Python 3.9+ with selenium and selenium-wire installed
- A matching browser driver (ChromeDriver or GeckoDriver)
- A Nefo account with prepaid bandwidth
- A username/password from /dashboard/generator
- Your target country token
Selenium proxy example with selenium-wire
With selenium-wire, pass the full proxy URL in the options:
The username USERNAME-country-us requests a rotating US residential IP; change the country token to move exits, or add state, city, or ASN tokens for precision.
from seleniumwire import webdriver
options = {
'proxy': {
'http': 'http://USERNAME-country-us:[email protected]:9000',
'https': 'http://USERNAME-country-us:[email protected]:9000',
}
}
driver = webdriver.Chrome(seleniumwire_options=options)
driver.get('https://api.ipify.org')Selenium rotating vs sticky proxy sessions
Rotating sessions rotate the IP on every request via HTTP port 9000, which fits parallel test runs and broad crawling.
Sticky sessions hold one IP from 1 minute up to 24 hours via HTTP port 10000. Add a token such as USERNAME-country-us-session-run7-lifetime-45 to keep the same IP for a 45-minute session, useful for stateful flows and logins.
Geo-targeting in the Selenium proxy username
All targeting is expressed in the username: country across 227 countries, US state and city, or ASN/ISP within a country. Only the username changes between regions, keeping your driver setup identical.
Automate lawfully, follow the target site's terms of service, and respect applicable law and sensible request pacing.
Frequently asked questions
Chrome and Firefox do not accept inline proxy credentials, which triggers a login popup that Selenium cannot fill. selenium-wire injects the username token and password automatically, so authentication just works.
Use HTTP port 9000 for rotating IPs or 10000 for sticky IPs. selenium-wire also supports SOCKS5 on ports 11000 and 12000 if you configure it that way.
Use port 10000 with a session token such as USERNAME-country-us-session-abc-lifetime-30 so one residential IP is kept for up to 24 hours. Use a new session id for each test that needs a fresh IP.
Yes. Set the country token in the username, such as USERNAME-country-gb. US state, city and ASN targeting use further tokens in the same username.
No. Generating credentials is free; only the traffic your browser routes through the proxy consumes prepaid bandwidth. See the docs for the connection reference.