`
sillycat
  • 浏览: 2536148 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Scrapy Tool Greapy and SpiderKeeper

 
阅读更多
Scrapy Tool Greapy and SpiderKeeper

On my Ubuntu Master Virtual Machine
Check PIP Version
> pip --version
pip 18.1 from /home/carl/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pip (python 3.6)
Install the Gerapy
> pip install gerapy
Check Version
> gerapy -version
0.8.5
In the working directory
> pwd
/home/carl/work
Initiate and create a working directory /home/carl/work/gerapy
> gerapy init
Initiate the database
> cd gerapy/
> gerapy migrate
Then there is  db.sqlite3
Start the Service
> gerapy runserver
Performing system checks...
System check identified no issues (0 silenced).
March 04, 2019 - 06:44:22
Django version 2.1.7, using settings 'gerapy.server.server.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Open to the world
> gerapy runserver 0.0.0.0:8000
Performing system checks...
System check identified no issues (0 silenced).
March 04, 2019 - 06:45:57
Django version 2.1.7, using settings 'gerapy.server.server.settings'
Starting development server at http://0.0.0.0:8000/
Then we can visit the page
http://ubuntu-master:8000/#/client
In the UI we can add clients and doing other things.
Install SpiderKeeper
> pip install spiderkeeper
> mkdir spiderkeeper
> cd spiderkeeper/
Start the web
> spiderkeeper --server=http://localhost:6800
Since Gerapy have no Authentication, we need to use SSH
> ssh -L 8010:localhost:8010 root@ubuntu-master -N
http://localhost:8010
Here is the major information to set up Docker Service
Here is the Dockerfile that have all the steps
#Set up Gerapy in Docker
#Prepre the OS
FROM centos/python-36-centos7
MAINTAINER Yiyi Kang <yiyikangrachel@gmail.com>
#set user
USER root
#install the softwarea
#upgrade pip
RUN pip3 install --upgrade pip
#install gerapy
RUN pip3 install gerapy
#init gerapy
RUN mkdir -p /tool/
WORKDIR /tool/
RUN gerapy init
WORKDIR /tool/gerapy/
RUN gerapy migrate
#set up the app
EXPOSE  8000
RUN     mkdir -p /app/
ADD     start.sh /app/
WORKDIR /app/

CMD    [ "./start.sh" ]
Here is the Makefile which have all the steps
IMAGE=sillycat/gerapy
TAG=sillycat-gerapy-1.0
NAME=sillycat-gerapy-1.0

docker-context:
build: docker-context
    docker build -t $(IMAGE):$(TAG) .
run:
    docker run -d -p 127.0.0.1:8010:8000 --restart always --name $(NAME) $(IMAGE):$(TAG)
debug:
    docker run -ti -p 8010:8000 --name $(NAME) $(IMAGE):$(TAG) /bin/bash
clean:
    docker stop ${NAME}
    docker rm ${NAME}
logs:
    docker logs ${NAME}
publish:
    docker push ${IMAGE}:${TAG}
fetch:
    docker pull ${IMAGE}:${TAG}
Here is the start command start.sh
#!/bin/sh -ex
#start the service
cd /tool/gerapy/
gerapy runserver 0.0.0.0:8000
Here is the readme how to access the UI
Gerapy use to list scrapyd.
## how to build
>make build
## how to run
>make run
## how ot stop
>make clean
## WebUI
ssh -L 8010:localhost:8010 carl@ubuntu-master -N
http://ubuntu-master:8010/
##

References:
https://blog.csdn.net/fengltxx/article/details/79894839
https://www.jianshu.com/p/f3447c90a0ec
https://github.com/Gerapy/Gerapy
https://github.com/DormyMo/SpiderKeeper
https://askubuntu.com/questions/112177/how-do-i-tunnel-and-browse-the-server-webpage-on-my-laptop
分享到:
评论

相关推荐

    Python-SpiderKeeper基于scrapy实现的爬虫管理WebUI

    **Python-SpiderKeeper:基于Scrapy实现的爬虫管理WebUI** SpiderKeeper是一个强大的工具,它为Python的Scrapy框架提供了一个用户友好的Web界面,使得爬虫项目的管理和运行变得更加方便。通过这个Web UI,开发者...

    基于Python3.7.8、Scrapy2.2.0、Scrapyd1.2.1的SpiderKeeper升级版设计源码

    SpiderKeeper升级版是一款专为Python 3.7.8、Scrapy 2.2.0和Scrapyd 1.2.1设计的爬虫管理工具源码,项目包含63个文件,涵盖Python脚本、JavaScript、HTML、CSS等多种编程语言和资源格式,包括13个Python脚本、10个...

    Scrapy安装文件及其依赖项

    Scrapy是一个强大的Python爬虫框架,它为开发者提供了一个高效且结构化的数据抓取环境。在Windows 7 64位系统上安装Scrapy时,需要确保安装一系列依赖项,这些依赖项对于Scrapy的正常运行至关重要。在这个压缩包文件...

    django+scrapy结合

    本篇文章将详细探讨如何将两个强大的Python库——Django和Scrapy结合,以实现通过Django的Web界面控制Scrapy爬虫的运行,并将爬取的数据存入数据库。 首先,让我们了解这两个框架的基本概念。Django是一个高级的Web...

    scrapy-redis-master_scrapy-redis_juzi1122_scrapy_

    9. **Scaling and Load Balancing**: 当需要增加爬取能力时,只需添加更多的Scrapy实例即可。由于Redis的队列特性,可以实现自动负载均衡,无需额外配置。 10. **Redis Pub/Sub**: 除了队列,Scrapy-Redis还可以...

    用Pyinstaller打包Scrapy项目例子

    然而,Scrapy项目通常是基于命令行启动的,这意味着在不安装Python和Scrapy的情况下无法直接运行。为了在不依赖Python环境的计算机上运行Scrapy项目,我们可以利用Pyinstaller将其打包成exe文件。 首先,确保你已经...

    scrapy 0.22.3

    ### Scrapy 0.22.3:一个强大的网络爬虫框架 #### 一、Scrapy简介 **Scrapy** 是一个用于爬取网站并提取结构化数据的应用框架,广泛应用于数据挖掘、信息处理或历史档案等领域。尽管最初设计是为了进行网页抓取...

    scrapy1.1 帮助文档

    - **版本控制和API稳定性(Versioning and API Stability)**:解释Scrapy版本控制策略以及API稳定性的承诺。 综上所述,Scrapy 1.1 版本的帮助文档全面覆盖了Scrapy的基本使用方法、高级特性及常见问题解决方案等多...

    scrapy-pyppeteer:Scrapy的Pyppeteer集成

    未维护如果您需要Scrapy的浏览器集成,请考虑使用Scrapy的Pyppeteer集成 该项目提供了一个Scrapy下载处理程序,该处理程序使用执行请求。 它可用于处理需要JavaScript的页面。 该软件包不会干扰常规的Scrapy工作流程...

    scrapy爬取大文件方法

    Scrapy是一个强大的Python爬虫框架,它为开发者提供了构建网络爬虫所需的各种工具和模块,使得数据抓取和处理变得更加高效。在处理大文件时,Scrapy提供了多种策略和技巧来确保过程的顺利进行。本篇文章将深入探讨...

    scrapy_Python的爬虫框架Scrapy_scrapy_

    Scrapy是Python编程语言中的一款强大且高效的网页抓取框架,专为数据抓取和爬虫项目设计。它提供了一整套工具集,使得开发者能够快速构建起复杂的网络爬虫,处理网页数据并进行分析。在本文中,我们将深入探讨Scrapy...

    py爬虫SpiderKeeper-master

    SpiderKeeper是一款用于管理Scrapy爬虫项目的工具,它提供了丰富的用户界面,使得开发者能够更加方便地监控和控制爬虫任务的状态与运行情况。根据给定的文件标题“py爬虫SpiderKeeper-master”,我们可以推断出该...

    百度百科爬虫Scrapy

    **Scrapy框架详解** Scrapy是一个强大的Python爬虫框架,专为爬取网站并提取结构化数据而设计。它的设计理念是使爬虫项目易于编写、维护,并提供了多种功能,如中间件、爬取调度器、下载器、Item Pipeline等,以...

    scrapy1.5-chinese-document-master.zip

    1. **《3-Command line tool.md.txt》**:这份文档介绍了Scrapy命令行工具的使用,包括如何创建项目、启动爬虫、生成配置文件等基本操作。了解这些命令将帮助用户快速初始化并管理Scrapy项目。 2. **《2-Scrapy ...

    bing、baidu搜索引擎爬虫 python3.6 and scrapy

    本项目主要关注的是使用Python3.6和Scrapy框架构建针对Bing和百度这两个主流搜索引擎的爬虫。下面将详细介绍这两个搜索引擎爬虫的相关知识。 首先,Python3.6是Python编程语言的一个版本,它具有强大的标准库,尤其...

    scrapy依赖文件包

    scrapy的所有依赖文件打包(不包含scrapy文件),scrapy文件可以自行安装pip后,用pip安装 命令为:pip install scrapy==1.0.5 scrapy1.0.5中文文档地址 ...

    scrapy-0.24中文文档|中文教程

    Scrapy是一个强大的Python爬虫框架,专为网页数据抓取和结构化数据提取设计。它提供了高效的爬取机制,使得开发者能够快速构建自己的网络爬虫项目。Scrapy 0.24是其早期的一个版本,虽然现在已经有更新的版本发布,...

    Scrapy文档1.4.0 文档

    ### Scrapy 1.4.0 文档概览与核心知识点 #### 一、Scrapy 概述 **Scrapy** 是一个用于爬取网站并提取结构化数据的强大框架,适用于各种规模的数据抓取项目。它能够高效地处理大规模数据,并提供了一套完整的工具和...

    scrapy&request_异步数据爬取_scrapy_

    Scrapy和Request是Python中两种常用的网络爬虫框架,它们都支持异步数据爬取,但各有特点。本文将深入探讨这两个工具在异步爬取中的应用及其优势。 首先,让我们了解一下什么是异步数据爬取。传统的同步爬虫在请求...

Global site tag (gtag.js) - Google Analytics