简体   繁体   中英

Chrome failed to start when running selenium on Linux server

I got the exception(below) when running Selenium with chrome driver version 74 on Linux server. It's running just fine on Windows

unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

I can prevent this error by adding "--headless" into ChromeOptions, but some elements cannot be found when run Selenium with headless mode. my current ChromeOptions use as example below.

options = new ChromeOptions();
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--user-data-dir=something");
options.addArguments("--start-maximized");

I am Linux beginner, Can someone help me to know is it possible to run headful Selenium on Linux server and also how to do it?

我建议你重新安装你的chrome并使用WebDriver Manager,你不需要用它来指示二进制文件的位置:对于Java - https://github.com/bonigarcia/webdrivermanager for Python - https:// github。 COM / SergeyPirogov / webdriver_manager

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM