前提・実現したいこと
PythonのSeleniumの初期設定(エラーなく,google chromeを自動で立ち上げるところまで)を完了させたいです。
補足情報の環境で試みていますが,エラーが発生してしまいます。
ご教授お願い致します。
発生している問題・エラーメッセージ
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/selenium/webdriver/common/service.py in start(self) 75 stderr=self.log_file, ---> 76 stdin=PIPE) 77 except TypeError: 4 frames /usr/lib/python3.6/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) 728 errread, errwrite, --> 729 restore_signals, start_new_session) 730 except: /usr/lib/python3.6/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) 1363 err_msg += ': ' + repr(err_filename) -> 1364 raise child_exception_type(errno_num, err_msg, err_filename) 1365 raise child_exception_type(err_msg) FileNotFoundError: [Errno 2] No such file or directory: '/Users/takiguchiisamu/Desktop/chromedriver': '/Users/takiguchiisamu/Desktop/chromedriver' During handling of the above exception, another exception occurred: WebDriverException Traceback (most recent call last) <ipython-input-29-403dccedc8d3> in <module>() 1 from selenium import webdriver 2 from selenium.webdriver.common.keys import Keys as keys ----> 3 driver = webdriver.Chrome(executable_path="/Users/takiguchiisamu/Desktop/chromedriver") 4 driver.get("https://aiacademy.jp/") /usr/local/lib/python3.6/dist-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive) 71 service_args=service_args, 72 log_path=service_log_path) ---> 73 self.service.start() 74 75 try: /usr/local/lib/python3.6/dist-packages/selenium/webdriver/common/service.py in start(self) 81 raise WebDriverException( 82 "'%s' executable needs to be in PATH. %s" % ( ---> 83 os.path.basename(self.path), self.start_error_message) 84 ) 85 elif err.errno == errno.EACCES: WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
該当のソースコード
from selenium import webdriver from selenium.webdriver.common.keys import Keys as keys driver = webdriver.Chrome(executable_path="/Users/takiguchiisamu/Desktop/chromedriver") driver.get("https://aiacademy.jp/")
試したこと
ChromeDriverを補足情報記載の最新バージョンではなく,ChromeDriver 76.0.3809.126を使用してみましたが,やはり出来ませんでした。
また,Windows10でも同じことをしましたがだめでした。
また,pathの格納場所を色々移動させたりしてみましたがだめでした。
補足情報(FW/ツールのバージョンなど)
使用ツール等
・mac
・google Colaboratory
・Google Chrome
バージョン: 76.0.3809.132(Official Build) (64 ビット)
・ChromeDriver 77.0.3865.40