scrapyd部署scrapy项目

安装scrapyd服务端:

pip install scrapyd

1、安装完成后在终端中输入scrapyd命令

在浏览器上访问该地址,看到如下图,则表示安装成功,服务端启动

2、安装scrapyd客户端

pip install scrapyd-client

执行scrapyd-deploy看到下面的则表示安装成功

3、修改scrapy项目中的scrapy.cfg

 4、执行scrapyd-deploy -l

5、scrapyd-deploy bd(你给deploy起的名字) -p pro1(项目名) 

查看scrapyd当前的服务和任务状态:curl http://localhost:6800/daemonstatus.json 

部署scrapy项目:curl http://localhost:6800/addversion.json -F project=myproject -F version=r23 -F [email protected]

启动爬虫:curl http://localhost:6800/schedule.json -d project=项目名 -d spider=蜘蛛名

关闭爬虫:curl http://localhost:6800/cancel.json -d project=项目名 -d job=任务id

列出所有部署的项目:curl http://localhost:6800/listprojects.json

查询某个项目的版本号:curl http://localhost:6800/listversions.json?project=项目名

查询某个项目最新的爬虫名:curl http://localhost:6800/listspiders.json?project=项目名

查看当前运行的任务的详情:curl http://localhost:6800/listjobs.json?project=项目名

删除项目的某个版本:curl http://localhost:6800/delversion.json -d project=项目名 -d bersion=版本号

删除项目某个:curl  http://localhost:6800/delproject.json -d project=项目名 

猜你喜欢

转载自www.cnblogs.com/dreamall/p/11865198.html