mirror of https://github.com/scrapy/scrapy.git
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:
parent
cc2a699458
commit
242bd38b3f
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue