scrapy run spider from script

后端 未结 4 890
野的像风
野的像风 2020-12-09 03:53

I want to run my spider from a script rather than a scrap crawl

I found this page

http://doc.scrapy.org/en/latest/topics/practices.html

4条回答
  •  轮回少年
    2020-12-09 04:38

    Why don't you just do this?

    from scrapy import cmdline
    
    cmdline.execute("scrapy crawl myspider".split())
    

    Put that script in the same path where you put scrapy.cfg

提交回复
热议问题