0
votes

The code:

from selenium import  webdriver
driver = webdriver.Chrome('/home/derlinuxnutzer/PycharmProjects/pythonProject1/chromedriver')
driver.get('https://www.google.com/')

The error: Traceback (most recent call last): File "/home/derlinuxnutzer/PycharmProjects/pythonProject1/hh.py", line 2, in driver = webdriver.Chrome('/home/derlinuxnutzer/PycharmProjects/pythonProject1/chromedriver') File "/home/derlinuxnutzer/PycharmProjects/pythonProject1/venv/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in init RemoteWebDriver.init( File "/home/derlinuxnutzer/PycharmProjects/pythonProject1/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "/home/derlinuxnutzer/PycharmProjects/pythonProject1/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/home/derlinuxnutzer/PycharmProjects/pythonProject1/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/home/derlinuxnutzer/PycharmProjects/pythonProject1/venv/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Process finished with exit code 1

1

1 Answers

0
votes

It should be with extension chromedriver.exe

from selenium import webdriver 
driver = webdriver.Chrome('/home/derlinuxnutzer/PycharmProjects/pythonProject1/chromedriver.exe')
driver.get('https://www.google.com/')

Ensure that your path is correct by calling it from terminal using cd command