I am using .net core 3.1 and Puppeteer Sharp 2.0.4. I want to get the full page HTML from a web page after the JavaScript has finished running. This is my code:
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);
Browser browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = false
});
var page = await browser.NewPageAsync();
page.DefaultTimeout = 0;
var navigation = new NavigationOptions
{
Timeout = 0,
WaitUntil = new[] {
WaitUntilNavigation.DOMContentLoaded }
};
await page.GoToAsync("https://someurl", navigation);
content = await page.GetContentAsync();
It looks like the content variable does not have the HTML after the JS finished running. Any advice on what I should change to make it work?