From 7e4d62778e3c2a7dc429fcdf931d2aa5e07adee2 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Sat, 7 Dec 2013 19:47:50 +0100 Subject: [PATCH] BaseSgmlLinkExtractor: Fixed unknown_endtag() so that it only set current_link=None when the end tag match the opening tag --- scrapy/contrib/linkextractors/sgml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapy/contrib/linkextractors/sgml.py b/scrapy/contrib/linkextractors/sgml.py index 9a63fcd53..fb903dd57 100644 --- a/scrapy/contrib/linkextractors/sgml.py +++ b/scrapy/contrib/linkextractors/sgml.py @@ -74,7 +74,8 @@ class BaseSgmlLinkExtractor(FixedSGMLParser): self.current_link = link def unknown_endtag(self, tag): - self.current_link = None + if self.scan_tag(tag): + self.current_link = None def handle_data(self, data): if self.current_link: