IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("https://www.example.com"); bool textPresent = driver.PageSource.ContainsText("Example Domain"); // textPresent will be true if "Example Domain" is found on the page
HttpClient client = new HttpClient(); HttpResponseMessage response = await client.GetAsync("https://www.example.com"); string responseBody = await response.Content.ReadAsStringAsync(); bool textPresent = responseBody.ContainsText("Example Domain"); // textPresent will be true if "Example Domain" is found in the response bodyPackage Library: System.Net.Http