I'm currently using PuppeteerSharp's 18.0.1 version in a .NET 6 application.
I've been using it with Chrome, but wanted to try it with Firefox. However, I failed to find any recent documentation explaining how to do it.
This is my code:
var browserFetcher = new BrowserFetcher(SupportedBrowser.Firefox);
await browserFetcher.DownloadAsync();
var launchOptions = new LaunchOptions()
{
Browser = SupportedBrowser.Firefox,
Headless = true
};
var browser = await Puppeteer.LaunchAsync(launchOptions);
var navigationOptions = new NavigationOptions()
{
Timeout = 60000,
WaitUntil = new WaitUntilNavigation[] { WaitUntilNavigation.Load, WaitUntilNavigation.Networkidle0 }
};
var page = await browser.NewPageAsync();
await page.GoToAsync("https://www.google.com/", navigationOptions);
This results in a timeout during the call to GoToAsync with following error:
PuppeteerSharp.NavigationException: Timeout of 60000 ms exceeded
---> System.TimeoutException: Timeout of 60000 ms exceeded
at PuppeteerSharp.Helpers.TaskHelper.<>c__DisplayClass6_0.<WithTimeout>b__0() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Helpers/TaskHelper.cs:line 53
at PuppeteerSharp.Helpers.TaskHelper.WithTimeout(Task task, Func`1 timeoutAction, TimeSpan timeout, CancellationToken cancellationToken) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Helpers/TaskHelper.cs:line 100
at PuppeteerSharp.Cdp.CdpFrame.GoToAsync(String url, NavigationOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpFrame.cs:line 104
--- End of inner exception stack trace ---
at PuppeteerSharp.Cdp.CdpFrame.GoToAsync(String url, NavigationOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpFrame.cs:line 108
What am I doing wrong? Is there some documentation regarding Firefox for me to base myself?
Hello,
I'm currently using PuppeteerSharp's 18.0.1 version in a .NET 6 application. I've been using it with Chrome, but wanted to try it with Firefox. However, I failed to find any recent documentation explaining how to do it.
This is my code:
This results in a timeout during the call to GoToAsync with following error:
What am I doing wrong? Is there some documentation regarding Firefox for me to base myself?