我需要打开铬或铬与 selenium 在Ubuntu 22部署在数码海洋VPS水滴。问题是它没有打开Chrome标签,Chrome和ChromeDriver的版本是相同的。这在我的本地主机ubuntu 22上运行得很好,但当我部署在VP中时,我无法运行它
options = webdriver.ChromeOptions()
options.add_extension(pluginfile)
driver = webdriver.Chrome('chromedriver', options=options)
我尝试了几种方法,包括这里的建议Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed
错误是
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /snap/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
正如我已经提到的,这将在具有相同操作系统、ChromeDriver和Chrome版本的本地主机上运行得非常好。
你知道怎么让它在越野车里工作吗?
1条答案
按热度按时间b4wnujal1#
经过几次尝试,我终于找到了VPS不允许Selify打开浏览器的原因。它只能在
headless
模式下工作,这不符合我的要求,因为我有插件,headless
模式不能与插件一起运行