redirects to home page without any content when opened using ChromeDriver chDriver.
I have used all recommended options that Github Copilot suggested (and those that made sense). Also, tried a few other options and combinations as well.
ChromeOptions options = new ChromeOptions();
options.PageLoadStrategy = PageLoadStrategy.Normal;
// Headful with desktop viewport
options.AddArgument("--start-maximized");
options.AddArgument("--window-size=1920,1080");
// Reduce automation fingerprints
options.AddArgument("--disable-blink-features=AutomationControlled");
options.AddExcludedArgument("enable-automation");
options.AddAdditionalOption("useAutomationExtension", false);
// Realistic UA (update to match your Chrome)
options.AddArgument("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
+ "(KHTML, like Gecko) Chrome/
120.0.0.0 Safari/537.36");
options.AddArgument("--lang=en-US");
ChromeDriver chDriver = new ChromeDriver(options);
chDriver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(60);
chDriver.Manage().Timeouts().AsynchronousJavaScript = TimeSpan.FromSeconds(30);
chDriver.Manage().Window.Maximize();
var js = (IJavaScriptExecutor)chDriver;
js.ExecuteScript("Object.defineProperty(navigator, 'webdriver', {get: () => undefined});");
js.ExecuteScript("
window.chrome =
window.chrome || {};
window.chrome.app = {isInstalled: false};");
js.ExecuteScript("Object.defineProperty(navigator, 'plugins', {get: () => [1,2,3]});");
js.ExecuteScript("Object.defineProperty(navigator, 'languages', {get: () => ['en-US','en']});");
chDriver.Navigate().GoToUrl(
https://gailgas.com/products/cng);
Can someone please help? Thank you in advance!