0
(P6Svenv)[email protected]:~/Projects/P6/P6Svenv/test2/test2/spiders$ scrapy crawl zomd
Traceback (most recent call last):
File "/usr/bin/scrapy", line 9, in <module>
load_entry_point('Scrapy==1.0.3.post6-g2d688cd', 'console_scripts', 'scrapy')()
File "/usr/lib/pymodules/python2.7/scrapy/cmdline.py", line 142, in execute
cmd.crawler_process = CrawlerProcess(settings)
File "/usr/lib/pymodules/python2.7/scrapy/crawler.py", line 209, in __init__
super(CrawlerProcess, self).__init__(settings)
File "/usr/lib/pymodules/python2.7/scrapy/crawler.py", line 115, in __init__
self.spider_loader = _get_spider_loader(settings)
File "/usr/lib/pymodules/python2.7/scrapy/crawler.py", line 296, in _get_spider_loader
return loader_cls.from_settings(settings.frozencopy())
File "/usr/lib/pymodules/python2.7/scrapy/spiderloader.py", line 30, in from_settings
return cls(settings)
File "/usr/lib/pymodules/python2.7/scrapy/spiderloader.py", line 21, in __init__
for module in walk_modules(name):
File "/usr/lib/pymodules/python2.7/scrapy/utils/misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/malikarumi/Projects/P6/P6Svenv/test2/test2/spiders/t350_crawl.py", line 36
def parse_item(self, response):
^
IndentationError: unindent does not match any outer indentation level
你看到了嗎? Scrapy甚至不會調用我在命令行上指定的蜘蛛!Scrapy調用除命令行指定的蜘蛛以外的其他蜘蛛
我在traceback中看到超級,但我所有的t350都來自CrawlSpider。 zomd是scrapy.Spider的子類。爲什麼會發生這種情況,我該怎麼辦?
@LearnAWK:是的,沒錯,在這種情況下,'zomd'在zomd.py中,而t350_crawl在t350_crawl.py中,所以我的問題仍然沒有答案。然而,Django有一個命令,我認爲它叫做'check',它通過項目中的所有代碼尋找錯誤;我想知道這是否是Scrapy中的一個類似功能? –