https://techacademy.jp/magazine/28392に書いてある
サンプルコードを実行しようとしたところ
以下のエラーがでました。原因と解決策を教えてください
よろしくお願いします。
当方の環境 macBigsurバージョン11.1です
brew pip pyenv chromedriver python3.9.1の環境構築は終わっております。
testname_suke@testname_uyuunoiMac-Pro python % python3 test2.py Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/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.9/lib/python3.9/subprocess.py", line 947, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child raise 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 "/Users/testname_suke/Desktop/python/test2.py", line 6, in <module> driver = webdriver.Chrome() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__ self.service.start() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
回答2件
あなたの回答
tips
プレビュー