2
I need to open the Chrome browser with Tor proxy settings using selenium. I was successful with firefox but it’s not very agile, so you need to use Chrome. The problem is I don’t know how to apply the settings to Chrome.
I need a working solution for the cromedriver.
in firefox did so, this method is called after the TOR BROWSER is opened:
private void ConfigureBrowser()
{
Logger.Log($"{Logger.MethodName()} -- Configurando Firefox...");
try
{
var ffOptions = new FirefoxOptions();
ffOptions.SetPreference("network.proxy.type", 1);
ffOptions.SetPreference("network.proxy.socks", "127.0.0.1");
ffOptions.SetPreference("network.proxy.socks_port", 9150);
ffOptions.AcceptInsecureCertificates = true;
var t = @"WebDrivers\";
Logger.Log($"{Logger.MethodName()} PATH GECKO -> {t}", ConsoleColor.DarkMagenta);
this.DRIVER = new FirefoxDriver(t, ffOptions);
this.Wait = new WebDriverWait(this.DRIVER, TimeSpan.FromSeconds(80));
Logger.Log($"{Logger.MethodName()} FIREFOX OK", ConsoleColor.DarkGreen);
}
catch (System.Exception e)
{
Logger.Log($"{Logger.MethodName()} ERRO AO INICIAR FIREFOX -> {e.ToString()}", ConsoleColor.DarkRed);
throw;
}
}