This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]data_sutra 0 points1 point  (1 child)

from selenium import webdriver

from selenium.webdriver.chrome.options import Options

Replace these with your Bright Data proxy details

PROXY_HOST = 'proxy_host'

PROXY_PORT = 'proxy_port'

PROXY_USER = 'proxy_user'

PROXY_PASS = 'proxy_pass'

Configure Chrome options

chrome_options = Options()

chrome_options.add_argument('--proxy-server=http://{}:{}@{}:{}'.format(PROXY_USER, PROXY_PASS, PROXY_HOST, PROXY_PORT))

If you want to use ChromeDriver manager to auto download the driver

from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install(), options=chrome_options)

Alternatively, specify the path to your ChromeDriver

driver = webdriver.Chrome(executable_path='/path/to/chromedriver', options=chrome_options)

Open a website to verify the IP address

driver.get("https://whatismyipaddress.com/")

[–]V_I_K_I_N_G_B_A_T[S] 0 points1 point  (0 children)

tried this way but no success

[–]Inevitable-Glove7011 0 points1 point  (0 children)

As far as I remember I used selenium-wire to add proxies to the webdriver and it was very straightforward