Fixing ChromeDriver Google Colab and Selenium issue – WebDriverException Service content chromedriver unexpectedly exited

ChromeDriver Google Colab and Selenium issue – WebDriverException Service /content/chromedriver unexpectedly exited is an error which usually occurs because of incompatibility issues between chrome and ChromeDriver.

Today, I explain why this error occurs and how to get rid of it, while also trying to add other possible solutions that could help you remove the error for good.

Exploring the Error : ChromeDriver Google Colab and Selenium issue – WebDriverException Service content chromedriver unexpectedly exited

This is an error which usually occurs because of incompatibility issues between chrome and ChromeDriver.

You should avoid mixing between different errors. The error message should look like the error message bellow.

Fixing ChromeDriver Google Colab and Selenium issue – WebDriverException Service content chromedriver unexpectedly exited

Bellow we will describe how the error can be solved. With multiple possible solutions.

Solution 1 : Solve incompatibility issues between ChromeDriver and Chrome.

As we said before, the error occurs because of incompatibility issues between ChromeDriver and chrome.

You can easily figure out which version of ChromeDriver you should choose for your chosen version of chrome by visiting the official ChromeDriver website.

This is what the ChromeDriver Team outlined.

                                                                       #
If you are using Chrome version 106, please download ChromeDriver 106.0.5249.21

If you are using Chrome version 105, please download ChromeDriver 105.0.5195.52
If you are using Chrome version 104, please download ChromeDriver 104.0.5112.79
                                                                       #

As you can see, it is easy to figure out how to solve this problem, I think the fix s clear now. Just go to the website and download the appropriate version of ChromeDriver .

Solution 2 : use phantomjs and selenium for google-colaboratory

This solution is only for google-colaboratory users.

Apparently you can only use selenium with phantomjs in google-colaboratory. I could not find anybody who managed to successfully use selenium and chrome in google-colaboratory.

In your notebook, you should install selenium like this.

                                                                       #
# In your notebook, you should install selenium like this.
!pip install selenium
                                                                       #

And then get phantomjs like this.

                                                                       #
# you can get phantomjs like this
!wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
                                                                       #

You can follow the instructions in this notebook and everything should be very clear.

I hope the fix above fixed your problem, good luck with the scripts to come.

Summing-up

I hope this article has helped you achieve your objective with solving the error : WebDriverException Service /content/chromedriver unexpectedly exited, If you like the effort we did here, please consider donating to our Kofi account located at the top of this page. Keep coding, cheers.

If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/