From 62f7171942512cedb576e944e15bb1bf5e19c859 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 d8f6ae4ec..bc8447529 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: