Python Crawler(3)Services

本文介绍如何使用Scrapyd服务启动、配置及监控Python爬虫项目。通过curl命令演示了如何启动爬虫、传递参数、列出项目和爬虫等操作,并提供了Scrapyd API和UI界面的访问方式。
Python Crawler(3)Services

Local Machine Service
Start the Service
>scrapyd

Call to start the services
>curl http://localhost:6800/schedule.json -d project=default -d spider=author
{"status": "ok", "jobid": "3b9c84c28dae11e79ba4a45e60e77f99", "node_name": "ip-10-10-21-215.ec2.internal"}

More API
http://scrapyd.readthedocs.io/en/stable/api.html#api

Call to Pass a Parameter
>curl http://localhost:6800/schedule.json -d project=myproject -d spider=somespider -d setting=DOWNLOAD_DELAY=2 -d arg1=val1

List Projects
>curl http://localhost:6800/listprojects.json
{"status": "ok", "projects": ["default", "tutorial"], "node_name": "ip-10-10-21-215.ec2.internal”}

List Spiders
>curl http://localhost:6800/listspiders.json?project=default
{"status": "ok", "spiders": ["author", "quotes"], "node_name": "ip-10-10-21-215.ec2.internal"}

UI of Status
http://localhost:6800/

http://scrapyd.readthedocs.io/en/stable/overview.html

Clustered Solution ?
https://github.com/rmax/scrapy-redis


References:
http://scrapyd.readthedocs.io/en/stable/overview.html#how-scrapyd-works
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值