I wrote a crawler in python, it works fine in pycharm, but it reports an error on the command line under linux
Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 4.14.0-deepin2-amd64 x86_64)
You are using arg –headless so with that my be you can try with another argument –no-sandbox and window-size=1024,768.
chrome.additional.capabilities={“chromeOptions”:{“args”:[“–headless”, “window-size=1024,768”, “–no-sandbox”], “binary”: “/home/ubuntu/software/chromedriver”}}
Solution:
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument("window-size=1024,768")
chrome_options.add_argument("--no-sandbox")
driver = webdriver.Chrome(chrome_options=chrome_options)
Read More:
- [Solved] deepin python Message: unknown error: cannot find Chrome binary
- Mac Selenium Use Error: Can not connect to the Service chromedriver
- [Solved] CUDA failure 999: unknown error ; GPU=-351697408 ; hostname=4f5e6dff58e6 ; expr=cudaSetDevice(info_.device_id);
- [Solved] pycuda._driver.LogicError: cuFuncSetBlockShape failed: invalid resource handle
- [Solved] command “python setup.py egg_info“ failed with error code 1
- [Solved] Command “python setup.py egg_info” failed with error code 1
- Pip3 install Mysqlclient Error: Command “python setup.py egg_info“ failed with error
- [Solved] Ubuntu18.04 Install pyqt5 error: Command “python setup.py egg_info“ failed with error code 1 in /tmp/pip-build-92
- [Solved] Unable to find “…\setuptools-40.8.0-py3.7.egg\EGG-INFO“ when adding binary and data files
- [Solved] PyCharm Failed to Start Error: failed to create jvm.jvm path…
- [Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn
- [Solved] Yolov5 Deep Learning Error: RuntimeError: DataLoader worker (pid(s) 2516, 1768) exited unexpectedly
- Xadmin Install Error: Command “python setup.py egg_info“ failed with error code 1 in C:\Users\ADMINI~1\AppDat
- [Solved] ERROR PythonRunner: Python worker exited unexpectedly (crashed)
- Vscode Tensorboard Error: We failed to start a TensorBoard session due to the following error: Command fa
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- httpd Run Error: Job for httpd.service failed because the control process exited with error code.
- [Solved] with ERRTYPE = cudaError CUDA failure 999 unknown error
- [Solved] PyCharm Error: Cannot open Local Terminal Failed to start [powershell.exe] in C:\Users\…….