用SCRAPYD安排蜘蛛

时间:2014-04-16 16:27:47

标签: scrapyd

我正在尝试安排蜘蛛跑,我写道:

curl http://localhost:6800/schedule.json -d project=elettronica -d spider=Prokoo

返回:

{"status": "error", "message": "'elettronica'"}

在scrapyd.log中,我看到:

2014-04-16 17:55:16+0200 [HTTPChannel,8,87.18.14.190] 87.18.14.190 - - [16/Apr/2014:15:55:16 +0000] "GET /schedule.json HTTP/1.1" 200 61 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36"
2014-04-16 17:55:35+0200 [HTTPChannel,10,127.0.0.1] Unhandled Error
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 1618, in allContentReceived
        req.requestReceived(command, path, version)
      File "/usr/lib/python2.7/dist-packages/twisted/web/http.py", line 773, in requestReceived
        self.process()
      File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 132, in process
        self.render(resrc)
      File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 167, in render
        body = resrc.render(self)
    --- <exception caught here> ---
      File "/usr/lib/pymodules/python2.7/scrapyd/webservice.py", line 18, in render
        return JsonResource.render(self, txrequest)
      File "/usr/lib/pymodules/python2.7/scrapy/utils/txweb.py", line 10, in render
        r = resource.Resource.render(self, txrequest)
      File "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line 216, in render
        return m(request)
      File "/usr/lib/pymodules/python2.7/scrapyd/webservice.py", line 37, in render_POST
        self.root.scheduler.schedule(project, spider, **args)
      File "/usr/lib/pymodules/python2.7/scrapyd/scheduler.py", line 15, in schedule
        q = self.queues[project]
    exceptions.KeyError: 'elettronica'

任何人都可以帮助我?

此致

丹尼斯

1 个答案:

答案 0 :(得分:0)

根据您的错误消息,您输入的项目名称错误

再次检查此行

curl http://localhost:6800/schedule.json -d project=elettronica -d spider=Prokoo

并确保更正项目名称elettronica