mirror of https://github.com/scrapy/scrapy.git
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:
parent
56e3d5ae66
commit
90fe6ef1b8
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue