Configure TrueProxies with Selenium
Python + Chrome with IP whitelisting
Section titled “Python + Chrome with IP whitelisting”from selenium import webdriverfrom selenium.webdriver.chrome.options import Options
PROXY = "YOUR_HOST:YOUR_HTTP_PORT"
chrome_options = Options()chrome_options.add_argument(f"--proxy-server=http://{PROXY}")
driver = webdriver.Chrome(options=chrome_options)driver.get("https://httpbin.org/ip")print(driver.page_source)driver.quit()Python + Firefox
Section titled “Python + Firefox”from selenium import webdriverfrom selenium.webdriver.firefox.options import Options
PROXY_HOST = "YOUR_HOST"PROXY_PORT = 8080
options = Options()options.set_preference("network.proxy.type", 1)options.set_preference("network.proxy.http", PROXY_HOST)options.set_preference("network.proxy.http_port", PROXY_PORT)options.set_preference("network.proxy.ssl", PROXY_HOST)options.set_preference("network.proxy.ssl_port", PROXY_PORT)
driver = webdriver.Firefox(options=options)driver.get("https://httpbin.org/ip")print(driver.page_source)driver.quit()Residential IPv4 country targeting
Section titled “Residential IPv4 country targeting”Use the username parameter:
PROXY_USER = "your_username-country-us"