我又遇到了这个错误,请看一下
"require-dev": {
"dbrekelmans/bdi": "^0.3.0",
"symfony/panther": "^1.1",
root@3914903c22bc:/auth_service# /usr/lib/chromium/chromium --version
Chromium 90.0.4430.212
root@3914903c22bc:/auth_service# drivers/chromedriver --version
ChromeDriver 90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430@{#429})
和错误
Facebook\WebDriver\Exception\UnknownErrorException: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
如何创建客户端
$this->panterClient = static::createPantherClient([
'--remote-debugging-port=9222',
'--no-sandbox',
'--disable-dev-shm-usage',
'--headless',
'--disable-gpu',
'--disable-extensions',
], [], ['request_timeout_in_ms' => 20000000]);
我的码头文件
ENV PANTHER_NO_SANDBOX 1
# Not mandatory, but recommended
ENV PANTHER_CHROME_ARGUMENTS='--disable-dev-shm-usage'
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb
RUN dpkg -i /tmp/chrome.deb || apt-get install -yf
RUN rm /tmp/chrome.deb