Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chromedriver: “FileNotFoundError: [Errno 2] No such file or directory:” Error

I couldn't solve this problem. I tried all the solutions I could find by going to the address below, but the problem was not solved. Please help me.

Chromedriver: "FileNotFoundError: [WinError 2] The system cannot find the file specified" Error

Program:

from selenium import webdriver

driver = webdriver.Chrome("C:\chromedriver\chromedriver.exe")
url = 'https://www.naver.com'
driver.get(url)

Error:

Traceback (most recent call last):
  File "/home/jsbang/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\chromedriver\\chromedriver.exe': 'C:\\chromedriver\\chromedriver.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "modu_pers_auto.py", line 21, in <module>
    driver = webdriver.Chrome(chrome_options=options, executable_path=r"C:\chromedriver\chromedriver.exe", )
  File "/home/jsbang/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/home/jsbang/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'C:\chromedriver\chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
like image 705
bbbbb Avatar asked Oct 26 '25 20:10

bbbbb


1 Answers

You should give the valid path if your executable is really there:

("C:\\chromedriver\\chromedriver.exe")

or

("C:/chromedriver/chromedriver.exe")
like image 124
Raymond Reddington Avatar answered Oct 29 '25 12:10

Raymond Reddington



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!