前提
pythonでseleniumのインストール後に
driverに入れる際にエラーが発生してしまいます
発生している問題・エラーメッセージ
エラーメッセージ FileNotFoundError Traceback (most recent call last) ~\anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self) 71 cmd.extend(self.command_line_args()) ---> 72 self.process = subprocess.Popen(cmd, env=self.env, 73 close_fds=platform.system() != 'Windows', ~\anaconda3\lib\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, user, group, extra_groups, encoding, errors, text, umask) 950 --> 951 self._execute_child(args, executable, preexec_fn, close_fds, 952 pass_fds, cwd, env, ~\anaconda3\lib\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, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session) 1419 try: -> 1420 hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 1421 # no special security FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。 During handling of the above exception, another exception occurred: WebDriverException Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_23432\2683281569.py in <module> ----> 1 driver = webdriver.Chrome('C:\\Users\\masay\\chomedriver.exe') ~\anaconda3\lib\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) 71 service_args=service_args, 72 log_path=service_log_path) ---> 73 self.service.start() 74 75 try: ~\anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self) 79 except OSError as err: 80 if err.errno == errno.ENOENT: ---> 81 raise WebDriverException( 82 "'%s' executable needs to be in PATH. %s" % ( 83 os.path.basename(self.path), self.start_error_message) WebDriverException: Message: 'chomedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
該当のソースコード
python
1ソースコード 2from selenium import webdriver 3driver = webdriver.Chrome('C:\\Users\\masay\\chomedriver.exe')
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
selenium 3.141.0
回答1件
あなたの回答
tips
プレビュー