All Projects → liangWenPeng → scrapy-admin

liangWenPeng / scrapy-admin

Licence: other
A django admin site for scrapy

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to scrapy-admin

Spiderkeeper
admin ui for scrapy/open source scrapinghub
Stars: ✭ 2,562 (+5722.73%)
Mutual labels:  spider, scrapy, scrapyd
Gerapy
Distributed Crawler Management Framework Based on Scrapy, Scrapyd, Django and Vue.js
Stars: ✭ 2,601 (+5811.36%)
Mutual labels:  spider, scrapy, scrapyd
Scrapydweb
Web app for Scrapyd cluster management, Scrapy log analysis & visualization, Auto packaging, Timer tasks, Monitor & Alert, and Mobile UI. DEMO 👉
Stars: ✭ 2,385 (+5320.45%)
Mutual labels:  spider, scrapy, scrapyd
163Music
163music spider by scrapy.
Stars: ✭ 60 (+36.36%)
Mutual labels:  spider, scrapy
small-spider-project
日常爬虫
Stars: ✭ 14 (-68.18%)
Mutual labels:  spider, scrapy
NScrapy
NScrapy is a .net core corss platform Distributed Spider Framework which provide an easy way to write your own Spider
Stars: ✭ 88 (+100%)
Mutual labels:  spider, scrapy
photo-spider-scrapy
10 photo website spiders, 10 个国外图库的 scrapy 爬虫代码
Stars: ✭ 17 (-61.36%)
Mutual labels:  spider, scrapy
elves
🎊 Design and implement of lightweight crawler framework.
Stars: ✭ 322 (+631.82%)
Mutual labels:  spider, scrapy
OpenScraper
An open source webapp for scraping: towards a public service for webscraping
Stars: ✭ 80 (+81.82%)
Mutual labels:  spider, scrapy
python-spider
python爬虫小项目【持续更新】【笔趣阁小说下载、Tweet数据抓取、天气查询、网易云音乐逆向、天天基金网查询、微博数据抓取(生成cookie)、有道翻译逆向、企查查免登陆爬虫、大众点评svg加密破解、B站用户爬虫、拉钩免登录爬虫、自如租房字体加密、知乎问答
Stars: ✭ 45 (+2.27%)
Mutual labels:  spider, scrapy
logparser
A tool for parsing Scrapy log files periodically and incrementally, extending the HTTP JSON API of Scrapyd.
Stars: ✭ 70 (+59.09%)
Mutual labels:  scrapy, scrapyd
V2EX Spider
V2EX爬虫
Stars: ✭ 21 (-52.27%)
Mutual labels:  spider, scrapy
Web-Iota
Iota is a web scraper which can find all of the images and links/suburls on a webpage
Stars: ✭ 60 (+36.36%)
Mutual labels:  spider, scrapy
scrapy helper
Dynamic configurable crawl (动态可配置化爬虫)
Stars: ✭ 84 (+90.91%)
Mutual labels:  spider, scrapy
devsearch
A web search engine built with Python which uses TF-IDF and PageRank to sort search results.
Stars: ✭ 52 (+18.18%)
Mutual labels:  spider, scrapy
Spider job
招聘网数据爬虫
Stars: ✭ 234 (+431.82%)
Mutual labels:  spider, scrapy
Scrapy IPProxyPool
免费 IP 代理池。Scrapy 爬虫框架插件
Stars: ✭ 100 (+127.27%)
Mutual labels:  spider, scrapy
Py Elasticsearch Django
基于python语言开发的千万级别搜索引擎
Stars: ✭ 207 (+370.45%)
Mutual labels:  spider, scrapy
Scrapy-Spiders
一个基于Scrapy的数据采集爬虫代码库
Stars: ✭ 34 (-22.73%)
Mutual labels:  spider, scrapy
scrapy-distributed
A series of distributed components for Scrapy. Including RabbitMQ-based components, Kafka-based components, and RedisBloom-based components for Scrapy.
Stars: ✭ 38 (-13.64%)
Mutual labels:  spider, scrapy

scrapy-admin

Overview

scrapy-admin 是一个针对scrapy的后台管理系统,使用django框架编写,具有定时调度、周期调度和状态监控等功能。

Requirements

python 3.4+
APScheduler 3.3+
Django 1.09+
pymongo 3.5+
requests 2.13+

Installation

这是一个django app,详细的安装部署方法可参考django文档,大致步骤如下:

  1. 新建一个django项目,并启用admin模块
  2. 将scrapy_admin拷贝到项目目录下
  3. 修改settings.py文件,在INSTALLED_APPS中添加scrapy_admin
  4. 修改urls文件,在urlpatterns中添加:url(r'^scrapyadmin/', include("scrapy_admin.urls"))
  5. 要使用状态监控和数据统计功能,需要在scrapy项目中添加MongoStateStore扩展
  6. 初始化数据库,启动django项目,登录管理后台

基本功能

初始设置

请确保scrapy已经正确部署到了scrapyd。若要使用状态监控和数据统计功能,请确保 scrapy已经添加了MongoStateStore扩展、正确设置了Mongodb数据库并在scrapy_admin/settings.py文件中填写了数据库信息。

关于MongoStateStore扩展

该扩展的作用是每隔一段时间,将爬虫的状态保存到Mongodb数据库中。要启用该扩展,除了在extendtions中添加该扩展外,还需要在scrapy settings文件中设置以下几个字段:

  1. MONGODB_URI:Mongodb的uri地址
  2. MONGODB_DATABASE:Mongo数据库名称
  3. MONGO_STATES_COLLECTION:保存状态数据的集合的名称
  4. MONGO_STATES_INTERVAL:保存状态的时间间隔,以秒为单位,整数值

数据模型

Cron

用于定义一个APSchulder中的cron对象,不同于一般的cron表达式,APSchulder中的cron对象对缺省值具有自动推断功能,具体参见:apscheduler.triggers.cron

Group

用于对任务进行分组,并对该组抓取的数据进行统计。

Job

爬虫的一个运行实例,对应scrapyd中的job概念。job由task自动创建,不可以手动创建,但可以手动停止一个正在运行的job。job的运行状态通过查询scrapyd获得,采用了异步查询方式,因此会存在一定的延迟。

Project

爬虫项目,对应scrapyd中的Project概念。

Spider

爬虫

Task

任务,用于创建定时或周期任务。

Worker

部署scrapyd的服务器节点,与Project是多对多关系。

创建任务

  1. 选择Group、Project、Spider
  2. 蜘蛛参数即为爬虫启动参数,格式为arg1=v1,arg2=v2
  3. 开始时间:当任务为定时任务(只会执行一次)时,到达开始时间,任务会开始执行。当任务为周期任务时,任务的首次执行时间不会早于开始时间。每次开始执行时候会创建j一个job。
  4. 单次执行时间:以分钟为单位。执行时间用完后会自动停止创建的job。0表示永远。
  5. Worker:任务运行的服务器节点,为空表示自动选择节点。自动选择的算法是,每到执行时间,选取一个空闲率最大的节点,空闲率的计算公式为:(最大工作数-运行工作数-排队工作数)/最大工作数目。
  6. 当任务为激活状态时,任务才会生效。任务保存后后台定时程序才会开始。

爬虫状态&数据统计

数据图绘制使用Echart书写

project

Group

task

job

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].