小编Blo*_*ten的帖子

为什么我需要“--no-sandbox”来运行 Selenium Chromedriver,即使具有管理员权限

我开始研究 Selenium (C#),令我惊讶的是,我什至无法运行Selenium Docs中最简单的项目。然而,我的同事开箱后就可以正常运行,没有任何问题。

我能够运行的唯一方法是将--no-sandbox选项添加到 Chrome 选项中。Firefox (Gekco) 驱动程序没有这个问题,并且我的 Chrome 版本和我的 Chromedriver 版本匹配。但我不能对每个项目都这样做,因为我们使用的库不通过此选项,并且它超出了我的控制范围。

我可能需要更改哪些策略/配置?

我试图在 S/O 上找到其他类似的线程,但没有一个能解决我的问题。大多数问题可以通过更新 Chrome/ChromeDriver 版本来解决,但我的是最新的 100(Chrome 99 也有同样的问题)。

错误

它只是停留在data:,并且不会继续到任何其他页面。

在此输入图像描述

Starting ChromeDriver 100.0.4896.60 (6a5d10861ce8de5fce22564658033b43cb7de047-refs/branch-heads/4896@{#875}) on port 61538
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

DevTools listening on ws://127.0.0.1:61542/devtools/browser/38c3268c-dd43-4100-bb1a-71aa2af4c1fc
Unhandled exception. OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:61538/session timed out after 60 seconds.
 ---> System.Threading.Tasks.TaskCanceledException: …
Run Code Online (Sandbox Code Playgroud)

c# selenium google-chrome selenium-chromedriver selenium-webdriver

7
推荐指数
1
解决办法
3万
查看次数