1. 程式人生 > >macOS+python3+selenium+chromedriver

macOS+python3+selenium+chromedriver

macOS selenium 開發環境

1,selenium安裝

pip3 search selenium
pip3 install selenium
pip3 show selenium

2,chromedriver下載

chromedriver_mac64.zip 下載
ChromeDriver - WebDriver for Chrome

3,chromedriver配置

mv chromedriver /
usr/local/bin/
chromedriver --version

測試

#! /usr/local/bin/python3
# coding:utf-8

from selenium import webdriver
from time import sleep

driver = webdriver.Chrome()
url = "http://www.baidu.com"
driver.get(url)
sleep(5)
driver.quit()

print ("測試")

在這裡插入圖片描述
參考:

  1. mac os+selenium2+chrome驅動+python3
  2. 2018 Mac 安裝Chromedriver及配置