Jupyterにて
Jupyter
1import selenium 2from selenium import webdriver 3browser = webdriver.Chrome()
を行ったとことErrが
Err
1--------------------------------------------------------------------------- 2FileNotFoundError Traceback (most recent call last) 3/usr/local/lib/python3.7/site-packages/selenium/webdriver/common/service.py in start(self) 4 75 stderr=self.log_file, 5---> 76 stdin=PIPE) 6 77 except TypeError: 7 8/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text) 9 799 errread, errwrite, 10--> 800 restore_signals, start_new_session) 11 801 except: 12 13/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session) 14 1550 err_msg += ': ' + repr(err_filename) 15-> 1551 raise child_exception_type(errno_num, err_msg, err_filename) 16 1552 raise child_exception_type(err_msg) 17 18FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver': 'chromedriver' 19 20During handling of the above exception, another exception occurred: 21 22WebDriverException Traceback (most recent call last) 23<ipython-input-4-78b07196e7cd> in <module> 24----> 1 browser = webdriver.Chrome() 25 26/usr/local/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive) 27 71 service_args=service_args, 28 72 log_path=service_log_path) 29---> 73 self.service.start() 30 74 31 75 try: 32 33/usr/local/lib/python3.7/site-packages/selenium/webdriver/common/service.py in start(self) 34 81 raise WebDriverException( 35 82 "'%s' executable needs to be in PATH. %s" % ( 36---> 83 os.path.basename(self.path), self.start_error_message) 37 84 ) 38 85 elif err.errno == errno.EACCES: 39 40WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
と出てきました。
GoogleChromeはバージョン: 80.0.3987.132(Official Build) (64 ビット)
chromedriver-binary-81.0.4044.20.0 をpip3にイントールしてあります.
どのように対処したら,新規でブラウザを立ち上げられますか?
ご教授のほどよろしくお願いいたします。
参照
https://teratail.com/questions/194886
--追記--
brew install chromedriverこちらを行おうとしたら
Error: No available formula with the name "chromedriver" Found a cask named "chromedriver" instead. Try brew cask install chromedriver
と出て来たため brew cask install chromedriverを行ったところ
brew cask install chromedriver Warning: Cask 'chromedriver' is already installed. To re-install chromedriver, run: brew cask reinstall chromedriver
と出て来たため brew cask reinstall chromedriverを行ったら
???? chromedriver was successfully installed!
となりました。そこで再度 brew install chromedriverを行ったら、
Error: No available formula with the name "chromedriver" Found a cask named "chromedriver" instead. Try brew cask install chromedriver
となってしまいました。
どのようにすればいいでしょうか。