【发布时间】:2021-03-11 17:11:11
【问题描述】:
将 google chrome 更新到最新版本后开始出现错误:89.0.4389.82 (Official Build) (64-bit)。 操作系统:Windows 10
错误:
PuppeteerSharp.ChromiumProcessException:
Failed to launch Chromium! [0309/160320.924:ERROR:os_crypt_win.cc(70)] Failed to encrypt: The system cannot find the file specified. (0x2)
请帮忙!
【问题讨论】:
-
修复了使用 Chromium 而不是 Chrome
-
请解释你做了什么来修复它。你如何“使用 Chromium 而不是 Chrome”。我以为 PuppeteerSharp 已经在使用 Chromium 了。
-
可以指定'Chromium'或'Chrome'的可执行路径``` var browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true, ExecutablePath = chromiumExecPath }); ```
-
谢谢!是的,ExecutablePath 就是答案。我以为我不需要指定它,因为我使用的是 BrowserFetcher.DownloadAsync("851527")。但我需要 ExecutablePath,因为我指定了要下载的特定版本(不是默认版本),它会转到一个单独的目录。