0
votes

I am new to Ubuntu. I installed google chrome and linux chrome driver successfully.

I imported the following :

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains

All these imports happen successfully. Post that I tried to run the following code :

driver = webdriver.Chrome('/usr/bin/chromedriver')

It gave the following error : selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

I went to powershell and checked where google chrome and chromedriver are installed : enter image description here

I see that they are installed in the correct path. But why isn't the code working then? why is it giving an error?

Please any help would be immensely appreciated!!

1
Try running your program as root and use the current version of webdriver with current browser. - Swaroop Humane
I wonder about two things: 1. Why we have the chromedriver both in /usr/bin/ and /usr/local/bin/ when only one is sufficient. 2. If the chromedriver is already at a place which is part of PATH variable, then what is the need of specifying path in webdriver.Chrome() - Deepam Gupta
@SwaroopHumane what do you mean by running the program as root? - Soumya Pandey
chromedriver.storage.googleapis.com/… @SoumyaPandey this is the place where you get the right webdiver. Delete the old one from both places /usr/local/bin and /usr/bin and put the new one at /usr/bin. Now start python in a new terminal and just do: from selenium import webdriver ; driver = webdriver.Chrome() ; also make sure you have the latest version of Chrome, and it is working perfectly. - Deepam Gupta
DO NOT post images of code, data, error messages, etc. - copy or type the text into the question. How to Ask - Rob

1 Answers

0
votes

This issue started on Google Chrome version 90. Version 89 worked just fine. I was hoping Google would fix it on version 91 but still has the same problem.