Fix error message when spider not found in parse command

This commit is contained in:
Ismael Carnales 2010-07-30 14:49:07 -03:00
parent e112def754
commit 9511a3154e
1 changed files with 4 additions and 1 deletions

View File

@ -84,6 +84,9 @@ class Command(ScrapyCommand):
return
else:
spider = spiders.create_for_request(request)
if spider is None:
log.msg('Unable to find spider for URL: %s' % args[0], log.ERROR)
return
scrapymanager.configure()
scrapymanager.queue.append_request(request, spider)
@ -112,7 +115,7 @@ class Command(ScrapyCommand):
for rule in spider.rules:
if rule.link_extractor.matches(response.url) \
and rule.callback:
items, links = self.run_callback(spider,
response, rule.callback,
args, opts)