0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

chromedriverが読み込めなくなった。(自分用メモ)

Last updated at Posted at 2021-02-02

内容

実行すると下記エラーが発生する。

$ python seleniumtest.py
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '': ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "seleniumtest.py", line 4, in <module>
    driver = webdriver.Chrome(executable_path='')
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: '' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

解決策

1. PATH直打ち

driver = webdriver.Chrome(executable_path='/c/******/******/chromedriver.exe')

バックスラであることに注意。

2. chromedriverの更新

下記を参照し使っているChromeのバージョンにあったchromedriverに更新する。
https://sites.google.com/a/chromium.org/chromedriver/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?