Fixed bug that didnt show extracted links in new spiders parse command

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40387
This commit is contained in:
elpolilla 2008-11-19 12:29:04 +00:00
parent 56e3d5ae66
commit 90fe6ef1b8
2 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,7 @@ class Command(ScrapyCommand):
def add_options(self, parser):
ScrapyCommand.add_options(self, parser)
parser.add_option("--nolinks", dest="nolinks", action="store_true", help="don't show extracted links")
parser.add_option("--links", dest="links", action="store_true", help="show extracted links")
parser.add_option("--noitems", dest="noitems", action="store_true", help="don't show scraped items")
parser.add_option("--identify", dest="identify", action="store_true", help="try to use identify instead of parse")
parser.add_option("--nocolour", dest="nocolour", action="store_true", help="avoid using pygments to colorize the output")
@ -46,7 +46,7 @@ class Command(ScrapyCommand):
print "# Scraped Items", "-"*60
display.pprint(items)
if not opts.nolinks:
if opts.links:
print "# Links", "-"*68
display.pprint(links)

View File

@ -68,6 +68,7 @@ class CrawlSpider(BaseSpider):
ret = []
for name in extractor_names:
extractor = getattr(self, name)
ret.extend(self._links_to_follow(response))
callback_name = 'parse_%s' % name[6:]
if hasattr(self, callback_name):
if extractor.match(response.url):