stuck at await browser.NewPageAsync()
See original GitHub issueI am just trying to create a simple console app to generate PDF file but program doesn’t execute after that line var page = await browser.NewPageAsync();
also i am not getting any exception as program is just stuck. Any help much appreciated.
console app code: Using .NET Core 2.2, PuppeteerSharp 1.17.1, C# version 7.1
class Program
{
public static async Task Main(string[] args)
{
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);
var browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true });
var page = await browser.NewPageAsync();
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.PreferCSSPageSize = true;
await page.GoToAsync("http://www.google.com", WaitUntilNavigation.Load);
await page.PdfAsync(Path.Combine(Directory.GetCurrentDirectory(), "google.pdf"), pdfOptions);
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:57 (22 by maintainers)
Top Results From Across the Web
Puppeteer-sharp: page is crashed from browser. ...
NewPageAsync() . Then I turned on Devtools and saw the page is crashed in Chromium. var browserFetcher = new BrowserFetcher(); await ...
Read more >Use PuppeteerSharp.Browser.NewPageAsync in ...
Use the NewPageAsync method in PuppeteerSharp package in your next ... FirstOrDefault() ?? await browser. NewPageAsync ();75 await browserPage.
Read more >Puppeteer in Node.js: Common Mistakes to Avoid
Puppeteer is a powerful Node.js library for browser automation, but comes with pitfalls. Find out some of the common mistakes you should ...
Read more >[Solved]-Puppeteer Sharp strange behaviour-C#
Run() will be stuck due to NewPageAsync() method. Bad behaviour: Task[] Tasks = new Task[1]; Browser browser = await Puppeteer.
Read more >Page | Playwright .NET
await using var browser = await playwright.Webkit.LaunchAsync(); var page = await browser.NewPageAsync(); await page.GotoAsync("https://www.theverge.com");
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure i did that but still stuck on this as well.
I have this issue again in version 5.0.0. I am running Puppeteer Sharp in a Linux Docker container. The issue does not occur when I run it directly on Windows 10.