技術と本について書くブログ

技術と本について書くblog。技術メモなど雑記を書いているblog。

macでseleniumをインストールする方法

macでseleniumをインストールする

$ brew install selenium-server-standalone
$ 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 caskroom/cask
$ brew cask install chromedriver

全然動かない場合 途中で処理を中断し、エラーメッセージを確認する

エラー内容

  File "/Users/ /.pyenv/versions/3.6.1/lib/python3.6/site-packages/selenium/webdriver/common/utils.py", line 106, in is_connectable
    socket_ = socket.create_connection((host, port), 1)
  File "/Users/ /.pyenv/versions/3.6.1/lib/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/Users/ /.pyenv/versions/3.6.1/lib/python3.6/socket.py", line 743, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

host名がおかしい。 ホストに以下を追加

127.0.0.1   localhost
$ pip install selenium
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
$ brew install openssl

selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /usr/local/bin/chromedriver