开发环境准备之 Selenium in Python

tags: 开发环境, Selenium, Python

安装 Selenium 包

pip install -U selenium

安装浏览器 Driver

我选择的是 ChromeDriver(安装参考

  1. 下载 ChromeDriver

  2. 复制 chromedrive 文件到 Google Chrome 程序目录下。

  3. Python 代码里创建 webdriver 对象时传递路径

chromedriver = "/Applications/Google Chrome.app/Contents/MacOS/chromedriver"
browser = webdriver.Chrome(chromedriver)```

参考资源

Selenium官网:http://www.seleniumhq.org/
selenium in python 教程:http://selenium-python.readthedocs.io/
selenium package API: https://seleniumhq.github.io/selenium/docs/api/py/index.html

[正文结束]

[更新记录]

2016-12-16,初建笔记

原文地址:https://www.cnblogs.com/buchiany/p/6399688.html