LoginSignup
3
1

More than 3 years have passed since last update.

【Mac】Selenium/jupyter notebook/Chromedriver install方法

Last updated at Posted at 2020-04-06

Selenium install方法

作業するフォルダへパスを通す。

例: desktopのworkフォルダにパスを通すなら
1. Terminalを開き cd ~/Desktop/work
2. Terminalにpwd を入力しパスが正しいか確認

pipを使用する場合

pip3 install Selenium

Anacondaを使用する場合

conda install Selenium

jupyter notebook install方法

pip使用する場合

pip install jupyter

Anacondaを使用する場合

conda install jupyter


下記URLが表示されるか確認
http://localhost:8888/tree

表示されているのならば、下記画像の「NEW」をクリックし新たなnotebookを作成。

image.png

chromedriver install方法

brew install chromedriver

しかし、自分の環境では、下記のエラーが出たため

image.png

エラーメッセージに従い下記コマンドを入力
brew cask install chromedriver

しかし、下記のように警告がでたため
image.png

警告に従い下記コマンドを入力
brew cask reinstall chromedriver

どうやら、前にchromedriverがインストールされていたよう。
とにかく、chromedriverをreinstall。

chromedriverインストール確認

jupyternotebookに下記を入力

from selenium import webdriver
browser = webdriver.Chrome()

image.png

これを実行し、Chromeブラウザが立ち上がったらインストール成功

3
1
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
3
1