PROXY = "127.0.0.1:9150"
webdriver.DesiredCapabilities.CHROME['proxy'] = {
"httpProxy": PROXY,
"ftpProxy": PROXY,
"sslProxy": PROXY,
"proxyType": "MANUAL",
"socksProxy": PROXY,
"socksVersion":5
}
you can use desired capabilities , you don't have to pass it as you are updating the capabilities for chrome directly
else you can also use
PROXY = "127.0.0.1:9150"
caps= webdriver.DesiredCapabilities.CHROME.copy()
caps['proxy'] = {
"httpProxy": PROXY,
"ftpProxy": PROXY,
"sslProxy": PROXY,
"proxyType": "MANUAL",
"socksProxy": PROXY,
"socksVersion":5
}
driver = webdriver.Chrome(desired_capabilities=caps)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…