在the scrapy tutorial中,我们看到项目命令crawl
正在运行:
scrapy crawl quotes
我想知道参数quotes
是因为earlier in the tutorial蜘蛛被命名为quotes_spider.py
。
答案 0 :(得分:3)
class QuotesSpider(scrapy.Spider):
name = "quotes"
在文档中列出了“抓取的引号”之后,下一行对此进行了说明。
此命令运行带有我们刚刚添加的名称引号的蜘蛛, 将会发送对quotes.toscrape.com域的一些请求
在上面显示的类中,蜘蛛的名称定义为name =“ quotes”。
您现在正在运行该蜘蛛类,因此参数是要运行的蜘蛛的名称。