Webdriver and proxy server for firefox

后端 未结 13 2365
清歌不尽
清歌不尽 2020-11-30 23:49

are there any ways to set firefox\'s proxy settings? I found here information about FoxyProxy but when Selenium works, plugins are unactivated in window.

13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 00:06

    According to the latest documentation

    from selenium import webdriver
    
    PROXY = ""
    webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
        "httpProxy": PROXY,
        "ftpProxy": PROXY,
        "sslProxy": PROXY,
        "proxyType": "MANUAL",
    
    }
    
    with webdriver.Firefox() as driver:
        # Open URL
        driver.get("https://selenium.dev")
    

提交回复
热议问题