Selenium Webdrive代理 - C#

时间:2018-03-05 15:04:26

标签: selenium selenium-webdriver selenium-chromedriver

有没有办法在运行Google Chrome时启用代理(例如在我登录邮箱后)?

1 个答案:

答案 0 :(得分:0)

是的,这是可能的:

PROXY = "proxy-here" # IP:PORT or HOST:PORT

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=%s' % PROXY)

chrome = webdriver.Chrome(chrome_options=chrome_options)
chrome.get("http://whatismyipaddress.com")

how do i set proxy for chrome in python webdriver