1
votes

I have replicated the exact codes given by scrapy in their first example, however it seems not to work. I have done lot of forum search and I see a lot of people getting same error. I would tend to believe that this could be because the installation may not be right. Wondering if any one of you can help looking at the logs.

This is the basic tutorial example given by Scrapy. Tutorial URL.

Command Line

D:\tutorial\tutorial\spiders>scrapy crawl dmoz_spider.py 2012-06-25 18:50:55+0530 [scrapy] INFO: Scrapy 0.14.4 started (bot: tutorial) 2012-06-25 18:50:55+0530 [scrapy] DEBUG: Enabled extensions: LogStats, TelnetConsole, CloseSpider, WebService, CoreStats, SpiderState 2012-06-25 18:50:56+0530 [scrapy] DEBUG: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMid dleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, RedirectMiddleware, CookiesMiddleware, HttpProxyMiddleware, HttpCompressionMiddleware, ChunkedTransferMiddleware, DownloaderStats 2012-06-25 18:50:56+0530 [scrapy] DEBUG: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware, Re fererMiddleware, UrlLengthMiddleware, DepthMiddleware 2012-06-25 18:50:56+0530 [scrapy] DEBUG: Enabled item pipelines: Traceback (most recent call last):
File "C:\Python27\Scripts\scrapy", line 5, in pkg_resources.run_script('scrapy==0.14.4', 'scrapy') File "C:\Python27\lib\site-packages\pkg_resources.py", line 489, in run_script self.require(requires)[0].run_script(script_name, ns)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1207, in run_script execfile(script_filename, namespace, namespace) File "c:\python27\lib\site-packages\scrapy-0.14.4-py2.7.egg\EGG-INFO\scripts\scrapy", line 4, in execute() File "C:\Python27\lib\site-packages\scrapy-0.14.4-py2.7.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.4-py2.7.egg\scrapy\cmdline.py", line 97, in _run_print_help func(*a, **kw) File "C:\Python27\lib\site-packages\scrapy-0.14.4-py2.7.egg\scrapy\cmdline.py", line 139, in _run_command cmd.run(args, opts) File "C:\Python27\lib\site-packages\scrapy-0.14.4-py2.7.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.4-py2.7.egg\scrapy\spidermanager.py", line 43, in create raise KeyError("Spider not found: %s" % spider_name)

KeyError: 'Spider not found: dmoz_spider.py'

1

1 Answers

4
votes

You don't start it by calling the spider module name in your case dmoz_spider.py. You start it with the name you gave to that spider.

In this case if you followed tutorial exactly it will be:

scrapy crawl dmoz