diff --git a/scrapy/contrib/linkextractors/sgml.py b/scrapy/contrib/linkextractors/sgml.py index 17877031d..03b2028cb 100644 --- a/scrapy/contrib/linkextractors/sgml.py +++ b/scrapy/contrib/linkextractors/sgml.py @@ -71,8 +71,8 @@ class BaseSgmlLinkExtractor(FixedSGMLParser): self.current_link = None def handle_data(self, data): - if self.current_link and not self.current_link.text: - self.current_link.text = data.strip() + if self.current_link: + self.current_link.text = self.current_link.text + data.strip() def matches(self, url): """This extractor matches with any url, since diff --git a/scrapy/tests/test_contrib_linkextractors.py b/scrapy/tests/test_contrib_linkextractors.py index a5e57bde0..0adc257ef 100644 --- a/scrapy/tests/test_contrib_linkextractors.py +++ b/scrapy/tests/test_contrib_linkextractors.py @@ -14,6 +14,7 @@ class LinkExtractorTestCase(unittest.TestCase):
+