Fixed another bug in parse command. Only links from matching rules were being extracted

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40466
This commit is contained in:
elpolilla 2008-12-03 14:24:14 +00:00
parent cc2a699458
commit 242bd38b3f
1 changed files with 4 additions and 4 deletions

View File

@ -83,12 +83,12 @@ class Command(ScrapyCommand):
else:
if hasattr(spider, 'rules'):
for rule in spider.rules:
extracted_links = rule.link_extractor.extract_urls(response)
for link in extracted_links:
links.add(Request(url=link.url, link_text=link.text))
if rule.link_extractor.matches(response.url):
ret_items, ret_links = self.run_method(spider, response, rule.callback, args, opts)
extracted_links = rule.link_extractor.extract_urls(response)
for link in extracted_links:
links.add(Request(url=link.url, link_text=link.text))
items = items.union(ret_items)
links = links.union(ret_links)
else: