Skip to content
Mirei edited this page Dec 26, 2021 · 1 revision

Selenium Proxy Authentication For Chrome

Easily add your auth proxies to your chrome Driver with one line of code With Extension

Installation

You Can Simply Add this Library to your project with Nuget Package:

Install-Package SeleniumProxyAuthentication.Chrome -Version 2.0.0

How to Use it

  • 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();

Guides

Proxy Format

  • Host:Port:Username:Password
  • Host:Port

Contact

Email: mahdi.blandsoft98.ir@gmail.com
Telegram: https://t.me/ONll_CH4N

Licence

License

Clone this wiki locally