PySpider爬虫框架介绍与phantomjs的安装

pyspider的介绍

PySpider是一种爬虫框架,基于PyQuery实现的。

一个国人编写的强大的网络爬虫系统并带有强大的WebUI。采用Python语言编写,分布式架构,支持多种数据库后端,强大的WebUI支持脚本编辑器,

优势:

        1.    基于多线程异步的调度方式;可实现爬虫的高并发爬取,注意使用代理。

        2.    它提供了一个WebUI的爬虫任务管理界面,可以实现爬虫的停止,启动,调试,支持定时爬取任务。

        3.    代码简洁。

        4.    支持动态网站的爬取;requests/urllib只能爬取静态网站。

劣势:

        1.    可拓展性不强。

      整体来说: 一些定制性高的,需要自定义一些功能的时候可以使用Scrapy,而一些定制性不高,不需要太多                      自 定义功能 时 使 用pyspider。

phantomjs的安装

介绍:

phantomjs:幽灵浏览器,*面版的浏览器

一:下载

        网址:http://phantomjs.org/download.html

        百度搜索如下:

    PySpider爬虫框架介绍与phantomjs的安装

 

        PySpider爬虫框架介绍与phantomjs的安装

二:安装

       1. 解压缩找到exe文件>>复制exe文件并复制到python.exe文件所在的位置

    PySpider爬虫框架介绍与phantomjs的安装

 

            a. 找到python.exe:

    PySpider爬虫框架介绍与phantomjs的安装

            b. 复制粘贴:

PySpider爬虫框架介绍与phantomjs的安装

三:启动

一定要先安装pyspider,安装过的不用再次安装,否则无法启动找不到pyspider命令!

pip install spider

PySpider爬虫框架介绍与phantomjs的安装

   1. cmd命令行启动>>进入浏览器查看并使用

            a.使用pyspider all命令  启动pyspider的所有组件

PySpider爬虫框架介绍与phantomjs的安装

 

           b. phantomjs也成功启动

PySpider爬虫框架介绍与phantomjs的安装

    2.进入浏览器查看

PySpider爬虫框架介绍与phantomjs的安装

删除的使用方式:

PySpider爬虫框架介绍与phantomjs的安装