Search code examples
pythonseleniumproxywebproxy

how to set autoconfig.url python selenium


In Java i am able to set AutoConfigUrl like mentioned below,

how to do the same in python ?

Proxy proxy = new Proxy();
              
proxy.setProxyAutoconfigUrl("http://wpad/wpad.dat");

Solution

  • Using Python and Selenium to set the proxyAutoconfigUrl you can use the following solution:

    from selenium.webdriver.common.proxy import Proxy
    
    
    prox = Proxy()
    prox.proxyAutoconfigUrl = "http://wpad/wpad.dat"
    capabilities = webdriver.DesiredCapabilities.CHROME.copy()
    prox.add_to_capabilities(capabilities)