How to set proxy server on Python?

Can someone give me some references to documentation, how to set proxy server on Python ?

Hi Aaron,

You can set the proxy server in your python script with the help of Google Chrome option arguments such as:

from selenium import webdriver
PROXY = "11.456.448.110:8080"
chrome_options = WebDriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=%s' % PROXY)
chrome = webdriver.Chrome(chrome_options=chrome_options)
chrome.get("https://www.google.com")

For more details, you can refer to the following link: A Guide to Localization Testing with Proxy Servers in Selenium - WonderProxy Blog

1 Like