前提
環境:
- mac OS
- anaconda python
- IPython
インストールしたもの:
- selenium
- chrome webdriver -> download
実行内容:
from selenium import webdriver
driver = webdriver.Chrome()
エラー内容:
WebDriverException: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
エラー解決までの手順
PATHの確認
IPythonでPATHを確認する方法
コンソール上で次を入力
%env PATH
出力
/opt/anaconda3/bin:/opt/anaconda3/condabin:/usr/bin:/bin:/usr/sbin:/sbin
出力されたディレクトリのどれかに chrome webdriver の実行ファイルを保存
chrome webdriver 実行を許可
macの”セキュリティとプライバシー” で実行を許可してください。
以上です。