Closed nomaam closed 2 years ago
Hi, I would like to work on this issue
Has anyone made any progress with this issue? I'm also experiencing the same issue.
selenium.__version__
Out[24]: '3.141.0'
any solution here how to pass authentication credentials?
@mpizosdim take a look at https://github.com/wkeeling/selenium-wire, it worked for me. Good luck
Not everyone can use selenium-wire. Is there any solution or a workaround to this?
This almost certainly is not a Selenium bug.
socksUsername & socksPassword were removed from the WebDriver spec long ago. This is the mozilla bug report
Your code should authenticate within the webdriver spec, e.g.
PROXY = "proxyusername:proxypassword@myproxy.com:8080"
webdriver.DesiredCapabilities.FIREFOX['proxy']={
"httpProxy":PROXY,
"sslProxy":PROXY,
"socksProxy":PROXY,
"noProxy":[],
"proxyType":"MANUAL"
}
Probably the reason that Selenium-Wire works is because it follows the current webdriver spec.
FYI, ftpProxy
was also removed from Firefox as of version 90......
For Selenium 4, first make sure it is a valid w3c session by using firefox options class
from selenium.webdriver.firefox.options import Options as FirefoxOptions
options = FirefoxOptions()
The proxy object gets set a property on that class: https://github.com/SeleniumHQ/selenium/blob/41a34dfbdfc70c90cc133e9a9cf5470236f0ff5e/py/selenium/webdriver/common/options.py#L204
options.proxy = proxy
The proxy itself is defined here: https://w3c.github.io/webdriver/#proxy and specifies:
A host and optional port for a scheme is defined as being a valid host, optionally followed by a colon and a valid port. The host may include credentials.
So you *should be able to do:
proxy = Proxy()
proxy.socks_proxy = "username:password@myproxy.com:8080"
Except that Firefox does not yet support this: https://github.com/mozilla/geckodriver/issues/1872
Not much work has been done on it either: https://bugzilla.mozilla.org/show_bug.cgi?id=1395886
There's nothing more Selenium can do for this. I've seen suggestions for using an intermediary proxy to manage credentials.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
🐛 Bug Report
Unable to use proxy with username / password
To Reproduce
Documentation
Error thrown
Expected behavior
To retrieve the website without errors
Test script or set of commands reproducing this issue
Code - Python
Error thrown
Environment
OS: Debian Browser: Latest version of Firefox and Chrome Browser version: Latest as of 2020-01-03 Browser Driver version: Latest as of 2020-01-03 Language Bindings version: Python Latest as of 2020-01-03