diff --git a/MoxfieldPriceScraper/MoxfieldScraper.cs b/MoxfieldPriceScraper/MoxfieldScraper.cs index be4f06f..f785435 100644 --- a/MoxfieldPriceScraper/MoxfieldScraper.cs +++ b/MoxfieldPriceScraper/MoxfieldScraper.cs @@ -114,6 +114,7 @@ private void InitializeWebDriver() chromeOptions.AddArgument("--window-size=2560,1440"); // Set window size chromeOptions.AddArgument("--log-level=3"); // Disable logging chromeOptions.AddExcludedArguments("enable-logging"); // Disable logging + chromeOptions.BinaryLocation = GetChromeLocation(); var preferences = new Dictionary { { "profile.managed_default_content_settings.images", 2 } // Disable image loading @@ -125,6 +126,19 @@ private void InitializeWebDriver() Log.Debug("WebDriver initialized with ImplicitWait set to {Timeout}", _elementSeekTimeout); } + /// + /// Gets the location of the Chrome/Chromium browser. + /// + /// + private static string GetChromeLocation() + { + var options = new ChromeOptions + { + BrowserVersion = "stable" + }; + return new DriverFinder(options).GetBrowserPath(); + } + /// /// Logs in to Moxfield with the provided credentials. ///