Skip to content

Selenium

Python + Chrome

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
PROXY = "connect.trueproxies.com:8080"
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

from selenium import webdriver
from selenium.webdriver.firefox.options import Options
PROXY_HOST = "connect.trueproxies.com"
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()

Country Targeting

Use the username parameter:

PROXY_USER = "your_username-country-us"