File "gmail_automation.py", line 16, in
driver = webdriver.Chrome(service=service) #, options=chrome_options)
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init
super().init(
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 53, in init
self.service.start()
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 98, in start
self._start_process(self._path)
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 204, in _start_process
self.process = subprocess.Popen(
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'chromedriver.exe'
shahar.katzir@MacBook-Pro Gmail-Creation-Automation-Python % python gmail_automation.py
Traceback (most recent call last):
File "gmail_automation.py", line 16, in
driver = webdriver.Chrome(service=service) #, options=chrome_options)
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init
super().init(
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 53, in init
self.service.start()
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 98, in start
self._start_process(self._path)
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 204, in _start_process
self.process = subprocess.Popen(
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/shahar.katzir/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'chromedriver.exe'
Hey bro,
Make sure you have downloaded the Chrome WebDriver appropriate for your system. You can get it from the official Selenium website or through a package manager like Homebrew.
For example, if you've downloaded the WebDriver and placed it in a directory like /usr/local/bin, your code should look something like this:
`from selenium import webdriver
chrome_driver_path = '/usr/local/bin/chromedriver'
driver = webdriver.Chrome(executable_path=chrome_driver_path)
`