Python 爬虫之pyspider
pyspider是一个支持任务监控、项目管理、多种数据库,具有WebUI的爬虫框架,它采用Python语言编写,分布式架构。详细特性如下:
拥有Web脚本编辑界面,任务监控器,项目管理器和结构查看器;
数据库支持MySQL、MongoDB、Redis、SQLite、Elasticsearch、PostgreSQL、SQLAlchemy;
队列服务支持RabbitMQ、Beanstalk、Redis、Kombu;
支持抓取JavaScript的页面;
组件可替换,支持单机、分布式部署,支持Docker部署;
强大的调度控制,支持超时重爬及优先级设置;
支持Python2&3。
pyspider主要分为Scheduler(调度器)、Fetcher(抓取器)、Processer(处理器)三个部分,整个爬取过程受到Monitor(监控器)的监控,抓取的结果被ResultWorker(结果处理器)处理。基本流程为:Scheduler发起任务调度,Fetcher抓取网页内容,Processer解析网页内容,再将新生成的Request发给Scheduler进行调度,将生成的提取结果输出保存。
2pyspidervsscrapypyspider拥有WebUI,爬虫的编写、调试可在WebUI中进行;Scrapy采用采用代码、命令行操作,实现可视化需对接Portia。
pyspider支持使用PhantomJS对JavaScript渲染页面的采集;Scrapy需对接Scrapy-Splash组件。
pyspider内置了PyQuery(Python爬虫(五):PyQuery框架)作为选择器;Scrapy对接了XPath、CSS选择器、正则匹配。
pyspider扩展性弱;Scrapy模块之间耦合度低,扩展性强,如:对接Middleware、Pipeline等组件实现更强功能。
总的来说,pyspider更加便捷,Scrapy扩展性更强,如果要快速实现爬取优选pyspider,如果爬取规模较大、反爬机制较强,优选scrapy。
以上内容为大家介绍了Python爬虫之pyspider,希望对大家有所帮助,如果想要了解更多Python相关知识,请关注IT培训机构:千锋教育。

猜你喜欢LIKE
相关推荐HOT
更多>>
python中的filter函数功能是什么?
python中的filter函数功能是什么?在python中,面对众多的数据,我们要过滤筛选出我们需要的数据。python中的filter函数就是起到了过滤筛选的作...详情>>
2023-11-10 20:37:27
pythontime模块是什么
pythontime模块是什么在python中使用时间,就免不了和time模块打交道,另外两个模块这个暂时先不做介绍。做time模块的使用上,我们可以用它来对...详情>>
2023-11-10 15:53:16
python是什么编程语言
python是什么编程语言1、说明是一种面向对象、解释型计算机程序设计语言,由GuidovanRossum于1989年底发明,第一个公开发行版发行于1991年。Pyt...详情>>
2023-11-10 15:21:05
python异常处理的两种技巧
python异常处理的两种技巧1、传递异常有时我们会在捕捉到一个异常后重新引发它(传递异常),实现起来很简单,使用不带参数的raise语句即可。deff...详情>>
2023-11-10 14:49:39热门推荐
python中的filter函数功能是什么?
沸python delattr函数如何使用?
热python中pdb模块怎么用?
热Python如何截图保存?
新python中缺少module怎么办?
python strftime和strptime的不同分析
python time.strptime的格式化
python中@contextmanager是什么?
python对象的三要素是什么
pythonGIL在Python多线程的应用
python如何对多个CSV文件进行读取
pythonif嵌套命令如何理解?
python对列表进行永久性或临时排序的方法
python生成器调用方法引发异常
技术干货






