Puppeteer LaunchAsync 在不打开浏览器的情况下挂起。

huangapple go评论71阅读模式
英文:

Puppeteer LaunchAsync Hangs Without Opening Browser

问题

我有一个使用 PupperteerSharp 的 .Net 应用程序,用于导航到不同的网页,一次只运行一个浏览器,一旦浏览器进程完成,就会关闭它,然后打开一个新的浏览器。

之前我使用的是 PuppeteerSharp 版本 V2.0.4,最近我升级到了 PuppeteerSharp 版本 V10.0.0,现在在尝试启动浏览器时出现了卡顿。一旦应用程序启动,它会运行一段时间,在打开和关闭了几个浏览器实例后,会在 await Puppeteer.LaunchAsync() 方法处卡住。

我正在运行的是 Windows 11 build 版本 22621.1702。

我当前使用的 Chromium 版本是 HeadlessChrome/109.0.5412.0

我使用以下配置来启动浏览器:

IBrowser browser = await Puppeteer.LaunchAsync(new LaunchOptions{
      Headless = true,
      IgnoreHTTPSErrors = true,
      Timeout = 60000,
      Args: [
        "--enable-automation",
        "--no-sandbox",
        "--disable-setuid-sandbox",
        "--disable-gpu", 
        "--disable-dev-shm-usage"
            ]
});
英文:

I have a .Net application that uses PupperteerSharp to navigate to different web pages, I have only one browser running at a given time and once that browser process is completed, it's closed before opening a new browser

Previously I had the PuppeteerSharp V2.0.4 and I recently updated to PuppeteerSharp V10.0.0 and now it's hanging after while when trying to launch a browser, Once the application started it runs for a while and after opening and closing few browser instances, it hangs at the await Puppeteer.LaunchAsync() method.

I'm Running this on Windows 11 build version 22621.1702.

The Chromium version I'm currently using is HeadlessChrome/109.0.5412.0

I use the below configuration to launch the browser,

IBrowser browser = await Puppeteer.LaunchAsync(new LaunchOptions{
      Headless = true,
      IgnoreHTTPSErrors = true,
      Timeout = 60000,
      Args: [
        "--enable-automation",
        "--no-sandbox",
        "--disable-setuid-sandbox",
        "--disable-gpu", 
        "--disable-dev-shm-usage"
            ]
});

答案1

得分: 1

PuppeteerSharp V10.0.0有一个关于浏览器关闭行为的未解决问题。请在上面的问题这里了解更多信息。
直到问题解决,建议降级到更稳定的版本,如V8.0.0。

英文:

PuppeteerSharp V10.0.0 has an open issue regarding this browser closing behavior. Please find more in the above issue here.
Until the issue is resolves Recommend downgrading to a version to a more stabler version. etc V8.0.0

huangapple
  • 本文由 发表于 2023年6月6日 16:11:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76412624.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定