2
2

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 5 years have passed since last update.

seleniumのセットアップ

Posted at

Anaconda使用
macOS Mojave バージョン10.14.6
Python 3.7

ターミナルで

pip install selenium
# 画像収集用するならこれも
pip install pillow

Firefox使用のために

brew install geckodriver

Chrome使用のために

brew install chromedriver

[brew install chromedriver]を実行したらエラーがでた

Error: No available formula with the name "chromedriver"
It was migrated from homebrew/core to homebrew/cask.
You can access it again by running:
brew tap homebrew/cask
And then you can install it by running:
brew cask install chromedriver

言われた通り

brew tap homebrew/cask
brew cask install chromedriver

再度

brew install chromedriver

ここからは、jupyter notebookで確認

# 下記の二つ実行してエラーがでなければinstall成功している
from selenium import webdriver
from PIL import Image

下記を実行するとFirefoxならFirefox
ChremeならChromeが立ち上がります。
注釈)webdriverでブラウザ立ち上げる。
# インストールできてたら下記実行(1つずつ)

browser = webdriver.Firefox()
browser = webdriver.Chrome()
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?