scrapyd 安装使用

scrapyd解决什么痛点?

1. 可以通过浏览器看爬虫的运行状态,包括时间,日志啊

2.可以通过curl直接运行爬虫和停止爬虫

1. 安装scrapyd

pip install scrapyd

2. 运行scrapyd

scrapyd

根目录下执行scrapyd

3.运行爬虫

curl http://localhost:6800/schedule.json -d project=default -d spider=spider2

4.停止爬虫

curl http://localhost:6800/cancel.json -d project=myproject -d job=你的jobId    (取消爬虫)

http://www.waitingfy.com/archives/3614

 

注意启动的时候,当前目录会生成 twistd.pid,万一非正常退出,起不来,报这个错误:

TypeError: ‘ProcessLookupError’ object is not subscriptable

把这个文件remove即可。

3614

Leave a Reply

Name and Email Address are required fields.
Your email will not be published or shared with third parties.