I'm trying to use selenium for a python web scraper but when I try to run the program I get the following error:
"/Applications/Python 3.8/IDLE.app/Contents/MacOS/Python" "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 52548 --file /Users/xxxx/git/python/python_crawler_example_01/naver_crawling.py
pydev debugger: process 3004 is connectingConnected to pydev debugger (build 192.7142.56)
Traceback (most recent call last):File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__self._execute_child(args, executable, preexec_fn, close_fds,File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_childraise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 81, in startraise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/homeProcess finished with exit code 1
It's my error code:
from selenium import webdriver
from bs4 import BeautifulSoup as bsimport time
import os, sysdriver = webdriver.Chrome()time.sleep(2)driver.close()
I'm using macos & pycharm
https://i.sstatic.net/dJtFi.jpg