Easily add your auth proxies to your chrome Driver with one line of code With Extension
You Can Simply Add this Library to your project with Nuget Package:
Install-Package SeleniumProxyAuthentication.Chrome -Version 2.1.1
Currently this library not working in the incognito browser mode
- i'm working on it and release a new version when it's completed
- First you need to download the chrome driver from here (make sure that the version of your chrome browser should be match with the version of chrome driver that you download!)
https://chromedriver.chromium.org/downloads
-
Then put the chromedriver.exe in your project directory
-
Create a global chrome option
private static readonly ChromeOptions ChromeOptions = new();
- Attach your proxy to the chrome option using the extension method that comes with nuget package
ChromeOptions.AddProxyAuthenticationExtension(new SeleniumProxyAuthentication.Proxy(
ProxyProtocols.HTTP,
"host:port:username:password"
));
- Cretae chrome driver and use the chrome option
IWebDriver driver = new ChromeDriver(ChromeOptions);
driver.Navigate().GoToUrl(new Uri("https://github.com"));
- Remove Entire Cache That Created By Extensions (In the Dispose Function)
chromeOptions.DeleteExtensionsCache();
- also see the sample project to see how it's work Link to sample project
- ✅ Host:Port:Username:Password
- ✅ Host:Port