Beispiel #1
0
        private static string ExtractHtmlWithChrome(string url)
        {
            Logger.Info($"Calling {url} with Chrome");
            string text = "";

            using (var driver = WebDriver.CreateChromeDriver(null))
            {
                driver.Navigate().GoToUrl(url);
                if (driver.Url == "about:blank")
                {
                    throw new WebException($"Chrome failed to navigate to url: {url}");
                }
                //Thread.Sleep(500);
                text = driver.PageSource;
            }

            return(text);
        }