我希望能够向我的Scrapy爬虫传递多个用户定义的参数,因此我试图按照这篇文章的建议进行操作:如何在Scrapy爬虫中传递一个用户定义的参数。
然而,当我按照那里的建议进行操作时,我遇到了一个错误:
root@ scrapy crawl dmoz -a address= 40-18 48th st -a borough=4
Usage
=====
scrapy crawl [options] <spider>
crawl: error: running 'scrapy crawl' with more than one spider is no longer supported
我也尝试了各种引号的排列组合:
root@ scrapy crawl dmoz -a address= "40-18 48th st" -a borough="4"
Usage
=====
scrapy crawl [options] <spider>
crawl: error: running 'scrapy crawl' with more than one spider is no longer supported
如何正确传递参数给Scrapy爬虫? 我想为爬虫的登录/抓取过程传递用户名和密码。感谢任何建议。
-a
开关接受一个key=value
参数,但是shell在scrapy
之前处理输入,并且等号后面的空格使其生成两个不同的标记,scrapy
将其解释为另一个爬虫。 - Birei