Selenium linux 下安装 chrome 却无法打开!

married577 · 2019年06月04日 · 最后由 married577 回复于 2019年06月05日 · 2962 次阅读

输入 python3,并编辑
from selenium import webdriver
driver = webdriver.Chrome()

提示如下:
selenium.common.exceptions.WebDriverException: Message: 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.)

按照网上说法,我在 driver 里禁用了 headless 这些东西,但是仍旧未能解决!

共收到 5 条回复 时间 点赞

记得之前我也想在 linux 下安装 chrome,直到后来发现了 zalenium

我试试

皆非 回复

但我执行 docker run --rm -ti --name zalenium -p 4444:4444 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/videos:/home/seluser/videos \
--privileged dosel/zalenium start 这串命令的时候,程序卡住了

Wensau 回复

我的代码是这样设定的,因为目前所有的解决方法都指向了这个,但是未能解决!!

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册