Authenticate Selenium traffic through LundProxy.
Authenticate Selenium traffic through LundProxy. This example uses Rotating Proxies as the default gateway and can be adapted by replacing endpoint and routing credentials.
Install the client and create a file.
Use a clean project environment and pin tested dependency versions for production. The example target is a public scraping sandbox.
python -m pip install selenium selenium-wireLoad proxy secrets from the environment.
The proxy username is not the LundProxy website login. Copy the complete username and password generated for the selected proxy product.
PROXY_USER=user-pool-crawlerPROXY_PASS=your-secretselenium_proxy.py
Copy the code into the named file, set credentials, and run it from the project environment.
import os
from seleniumwire import webdriver
from selenium.webdriver.common.by import By
proxy = (
"http://"
f"{os.environ['PROXY_USER']}:{os.environ['PROXY_PASS']}"
"@proxy.lundproxy.com:36923"
)
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
driver = webdriver.Chrome(
options=options,
seleniumwire_options={
"proxy": {"http": proxy, "https": proxy, "no_proxy": "localhost"},
},
)
try:
driver.set_page_load_timeout(30)
driver.get("https://quotes.toscrape.com/js/")
print(len(driver.find_elements(By.CSS_SELECTOR, ".quote")))
finally:
driver.quit()
Keep the important behavior visible.
Add workload-specific controls before scale.
Test representative targets, response sizes, routing policy, concurrency, retries, validation, and completion window. Collect only public data you are authorized to access.
Selenium Wire questions.
Why use Selenium Wire?
It provides authenticated upstream proxy configuration around Selenium traffic.
Can I use a plain Chrome flag?
A proxy-server flag alone does not reliably solve authenticated proxy credentials in every Chrome setup.
What should I pin?
Pin Selenium, Selenium Wire, browser, and driver versions in a tested environment.