报废 - 同时运行蜘蛛时出错

时间:2016-05-17 09:36:35

标签: python scrapy scrapyd

我试图用scrapyd同时运行两只scrapy蜘蛛。 我执行

curl http://localhost:6800/schedule.json -d project=myproject -d spider=somespider

结果 - {"状态":"确定"," jobid":" 6487ec79947edab326d6db28a2d86511e8247444"} 然后:

curl http://localhost:6800/schedule.json -d project=myproject -d spider=somespider2

结果 -

    python2.7/site-packages/twisted/web/server.py", line 234, in render
            body = resrc.render(self)
        --- <exception caught here>
        File "/usr/local/lib/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
            exceptions.ValueError: No JSON object could be decoded

每次我为scrapyd运行curl - 我得到相同的 - exceptions.ValueError:没有JSON对象可以被解码。继续使用scrapyd的唯一方法 - 重新启动它。 如何使用报废运行多个蜘蛛?为什么我会收到这个错误?

我使用scrapy 1.1,scrapyd 1.1,python 2.7.9

2 个答案:

答案 0 :(得分:0)

你的错误与scrapyd无关,很可能错误在你的蜘蛛'somespider2'中。只需确保您能够通过命令行正确运行'somespider2'。

答案 1 :(得分:0)

问题出在我的Centos6.5中安装了sqlite3。 决定: 需要添加

self.conn.text_factory = bytes
scrapyd/sqlite.py b/scrapyd/sqlite.py

中创建连接后,

到SqliteDict和SqlitePriorityQueue类

相关问题