Running Multiple Scrapy Spiders (the easy way) Python

前端 未结 3 934
清歌不尽
清歌不尽 2020-12-28 09:11

Scrapy is pretty cool, however I found the documentation to very bare bones, and some simple questions were tough to answer. After putting together various techniques from v

3条回答
  •  盖世英雄少女心
    2020-12-28 09:52

    yes there is an excellent companion to scrapy called scrapyd that's doing exactly what you are looking for, among many other goodies, you can also launch spiders through it, like this:

    $ curl http://localhost:6800/schedule.json -d project=myproject -d spider=spider2
    {"status": "ok", "jobid": "26d1b1a6d6f111e0be5c001e648c57f8"}
    

    you can add your custom parameters as well using -d param=123

    btw, spiders are being scheduled and not launched cause scrapyd manage a queue with (configurable) max number of running spiders in parallel

提交回复
热议问题