相关疑难解决方法(0)

org.openqa.selenium.WebDriverException:未知错误:尝试启动Chrome浏览器时,DevToolsActivePort文件不存在

我正在尝试使用URL启动chrome,浏览器启动,之后它什么都不做.

我在1分钟后看到以下错误:

Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
  (Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
Run Code Online (Sandbox Code Playgroud)

我的配置:

Chrome:66 ChromeBrowser:2.39.56

PS在Firefox中一切正常

selenium google-chrome webdriver selenium-chromedriver selenium-webdriver

120
推荐指数
16
解决办法
11万
查看次数

selenium.common.exceptions.WebDriverException:消息:未知错误:Chromium 浏览器和 Selenium Python 中不存在 DevToolsActivePort 文件

我想通过铬运行硒。我写了这段代码:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
options.add_argument("--disable-gpu")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--no-sandbox")
options.binary_location = "/snap/bin/chromium"
driver = webdriver.Chrome(chrome_options=options)
Run Code Online (Sandbox Code Playgroud)

但这段代码会抛出一个错误:

selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
Stacktrace:
#0 0x55efd7355a23 <unknown>
#1 0x55efd6e20e18 <unknown>
#2 0x55efd6e46e12 <unknown>
Run Code Online (Sandbox Code Playgroud)

正确版本的 chromedriver 位于 usr/bin 中。我究竟做错了什么?

python chromium selenium-chromedriver selenium-webdriver selenium-webdriver-python

7
推荐指数
2
解决办法
4万
查看次数

显示错误 - 未知错误:DevToolsActivePort 文件不存在 - 它是电子应用程序(我使用的是 Windows 操作系统))

当我运行代码时,它显示以下错误 - Electron application

org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist.
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'DESKTOP-GN8LLQU', ip: '192.168.1.20', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.2'
Driver info: driver.version: ChromeDriver
Run Code Online (Sandbox Code Playgroud)

我的代码:

ChromeOptions opt = new ChromeOptions();
// path of your Electron Application
opt.setBinary("D:\\FOS\\fiber-optic-system-electron\\release\\angular-electron 0.1.0.exe");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("chromeOptions", opt);
capabilities.setBrowserName("chrome");
System.setProperty("webdriver.chrome.driver", "E:\\chromedriver_win32 (6)\\chromedriver.exe");
WebDriver driver = new ChromeDriver(capabilities);
Run Code Online (Sandbox Code Playgroud)

selenium google-chrome selenium-chromedriver electron java-11

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

Chrome 驱动程序在 Laravel Dusk 中失败 - “无法打开流:HTTP 请求失败!404 未找到”

在最后一天左右,我开始看到我的 Laravel Dusk 测试在我的 CI/CD 环境中失败(GitHub Actions)。

突然,运行一直运行良好的命令:

php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
Run Code Online (Sandbox Code Playgroud)

..失败并出现错误:

file_get_contents(https://chromedriver.storage.googleapis.com/LATEST_RELEASE_116):无法打开流:HTTP请求失败!HTTP/1.1 404 未找到

尝试通过强制版本 114 来解决此问题:

php artisan install:chrome-driver 114
Run Code Online (Sandbox Code Playgroud)

...失败并出现错误:

Facebook\WebDriver\Exception\SessionNotCreatedException:会话未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 114

我该如何解决这个问题并让我的测试再次开始通过?

php laravel selenium-webdriver laravel-dusk

2
推荐指数
1
解决办法
1015
查看次数