scrapy蜘蛛传递参数

时间:2014-02-01 11:03:36

标签: python python-2.7 scrapy

我有这样的蜘蛛

def __init__(self, FirstDateString, LastDateString):

我打电话给我的CMD是这样的:

scrapy crawl Test -a FirstDateString=1st February 2014 -a LastDateString=31th January 2014

但我得到了这个例外:

  scrapy crawl [options] <spider>

crawl: error: running 'scrapy crawl' with more than one spider is no longer supp
orted

请帮助

1 个答案:

答案 0 :(得分:3)

您应该在参数值周围使用引号:

scrapy crawl Test -a FirstDateString="1st February 2014" -a LastDateString="31th January 2014"