Python code works:
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-automation'])
But the C# code is not working:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddAdditionalCapability("excludeSwitches", "disable-popup-blocking");
List<string> ls = new List<string>();
ls.Add("enable-automation");
ChromeOptions options = new ChromeOptions();
options.AddExcludedArguments(ls);
using (IWebDriver driver = new ChromeDriver("C:\\Program\\chromedriver", options))
{
Console.ReadKey();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With