I am creating a bot that goes to a website, changes proxy, and then reloads the website. I want the update the proxy for the chrome web driver in the loop, but I only found a way to do it if I create a new web driver with a new proxy. I only want to update the current chrome drivers proxy, not create a new one with a new proxy.
IWebDriver driver;
for (int i = 0; i < listBoxNames.Items.Count; i++)
{
ChromeOptions settings = new ChromeOptions();
Proxy Proxy = new Proxy();
Proxy.Kind = ProxyKind.Manual;
Proxy.IsAutoDetect = false;
Proxy.SslProxy = Proxies[i];
settings.Proxy = Proxy;
settings.AddArgument("ignore-certificate-errors");
driver = new ChromeDriver(settings);
}
This code creates a new web driver every time it cycles through the loop. How can I make it so it only updates a new proxy to the current web driver instead?