When attempting to utilize Selenium to create a crawler on a server, encountering the error:
WebDriverException Traceback (most recent call last) ... WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 127
indicates that additional libraries are required for the proper functioning of Chromedriver. To resolve this issue, the following command can be executed:
apt-get install -y libglib2.0-0=2.50.3-2 \ libnss3=2:3.26.2-1.1+deb9u1 \ libgconf-2-4=3.2.6-4+b1 \ libfontconfig1=2.11.0-6.7+b1
Alternatively, one can iteratively run Chromedriver from the command line and utilize the apt-cache search and apt-cache madison commands to identify the precise versions of the required deb packages.
Additional Note
The specific packages required may vary depending on the Chromedriver version in use. Using the ldd command to list the shared object dependencies can also be helpful in identifying missing libraries.
The above is the detailed content of How to Fix 'WebDriverException: Service chromedriver unexpectedly exited' on Linux Servers?. For more information, please follow other related articles on the PHP Chinese website!