Scrapy newbie: tutorial. error starting scraw crawl dmoz

I set my PATH variables and I think that everything is set up correctly. But when I run "scram crawl dmoz" in my startproject folder, I get the following error messages:

c:\matt\testing\dmoz>scrapy crawl dmoz
2012-04-24 18:12:56-0400 [scrapy] INFO: Scrapy 0.14.0.2841 started (bot: dmoz)
2012-04-24 18:12:56-0400 [scrapy] DEBUG: Enabled extensions: LogStats, TelnetConsole,         
CloseSpider, WebService, CoreStats, SpiderState
2012-04-24 18:12:56-0400 [scrapy] DEBUG: Enabled downloader middlewares:    
HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware,
faultHeadersMiddleware, RedirectMiddleware, CookiesMiddleware,   
HttpCompressionMiddleware, ChunkedTransferMiddleware, DownloaderStats
2012-04-24 18:12:56-0400 [scrapy] DEBUG: Enabled spider middlewares:   
HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware,  DepthMiddware
2012-04-24 18:12:56-0400 [scrapy] DEBUG: Enabled item pipelines:
Traceback (most recent call last):
File "c:\Python27\Scripts\scrapy", line 4, in <module>
execute()
File "c:\Python27\lib\site-packages\scrapy-0.14.0.2841-py2.7- 
win32.egg\scrapy\cmdline.py", line 132, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "c:\Python27\lib\site-packages\scrapy-0.14.0.2841-py2.7-
win32.egg\scrapy\cmdline.py", line 97, in _run_print_help
func(*a, **kw)
File "c:\Python27\lib\site-packages\scrapy-0.14.0.2841-py2.7-
win32.egg\scrapy\cmdline.py", line 139, in _run_command
cmd.run(args, opts)
File "c:\Python27\lib\site-packages\scrapy-0.14.0.2841-py2.7-
win32.egg\scrapy\commands\crawl.py", line 43, in run
spider = self.crawler.spiders.create(spname, **opts.spargs)
File "c:\Python27\lib\site-packages\scrapy-0.14.0.2841-py2.7-  
win32.egg\scrapy\spidermanager.py", line 43, in create
raise KeyError("Spider not found: %s" % spider_name)
KeyError: 'Spider not found: dmoz'

Does anyone know what could happen?

+3
source share
2 answers

I also had this problem.

This is because the shooting tutorial asks you to place the created spider in /dmoz/spiders/, but scrapy looks in tutorial/tutorial/spiders.

Save dmoz_spider.pyin tutorial/tutorial/spidersand bypass should work.

+12
source

try on the command line

C:\Users\Akhtar Wahab> python # any any directory path

if it works

try

scrapy version

if it also works

then make sure you have done the scrapy project with

scrapy startproject name

, scraper , scrapy.cfg.

0

All Articles