Advertisement
dereksir

Untitled

Dec 5th, 2023
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using SeleniumUndetectedChromeDriver;
  2.  
  3. class Program
  4. {
  5.     static async Task Main()
  6.     {
  7.         using (var driver = UndetectedChromeDriver.Create(driverExecutablePath: await new ChromeDriverInstaller().Auto()))
  8.         {
  9.             // Navigate to the website
  10.             driver.GoToUrl("https://nowsecure.nl");
  11.  
  12.             // Get the HTML content
  13.             var htmlContent = driver.ExecuteScript("return document.documentElement.outerHTML;") as string;
  14.  
  15.             // Print the HTML content
  16.             Console.WriteLine($"HTML Content:\n{htmlContent}");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement