win10+selenium+python配置(chrome)

selenium可以在https://pypi.org/project/selenium/查看相应的版本,使用pip安装
接下来安装chrome驱动,需要翻墙,地址是:http://chromedriver.storage.googleapis.com/index.html
下载时对应自己电脑上的chrome浏览器版本。在关于里查看。
win10+selenium+python配置(chrome)
在c盘建一个文件夹,将chromedriver.exe放在其中,使用时需要指明这个路径:

from selenium import webdriver
browser = webdriver.Chrome(executable_path="C:\driver\chromedriver.exe")
browser.get('http://www.baidu.com')

然后就会得到:
win10+selenium+python配置(chrome)