首页 > 技术文章 > Selenium 介绍及安装

orangeseason 2015-07-07 17:24 原文

 

Selenium 介绍

Selenium 提供了一种更为简便的网络爬虫技术,根据橘子目前的体验,Selenium具有以下特点:

  1. 开源,免费
  2. 简单,是一种OO方式,容易上手。
  3. 适应网络编码改变。相比urllib库,由于urllib趴出的网页是html格式,提取有用信息需要通过re进行过滤,网站代码若有些微改变,re正则表达式也会相应改变。而selenium适应性更强。

它为目前流行的浏览器如Firefox, IE, Chrome, Remote等等。目前Selenium支持的版本包括2.7, 3.2, 3.3 and 3.4

 

Selenium 安装

有多种安装方式,这儿提供一种简单的安装方式,即通过pip进行安装

pip install selenium

 

Selenium 参考地址

Home:
http://www.seleniumhq.org

Get Start

https://selenium-python.readthedocs.org/

Docs:

http://selenium.googlecode.com/git/docs/api/py/index.html
selenium package API

Dev:
https://code.google.com/p/selenium/

PyPI:
https://pypi.python.org/pypi/selenium

IRC:
#selenium channel on freenode

推荐阅读