Mac命令行安装ChromeDriver
使用Mac命令行安装ChromeDriver为:
brew cask install chromedriver
安装过程为:
➜ ~ brew cask install chromedriver
==> Satisfying dependencies
==> Downloading https://chromedriver.storage.googleapis.com/76.0.3809.126/chrome
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'chromedriver'.
==> Installing Cask chromedriver
==> Linking Binary 'chromedriver' to '/usr/local/bin/chromedriver'.
🍺 chromedriver was successfully installed!
在Python中测试为:
>>> from selenium import webdriver
>>> browser = webdriver.Chrome()
>>> browser.get('https://xiaoledeng.github.io')
自动弹出一个网页,然后自动打开网页https://xiaoledeng.github.io。