BaseSgmlLinkExtractor: Fixed the missing space when the link has an inner tag

This commit is contained in:
Benoit Blanchon 2013-12-07 20:43:22 +01:00 committed by Daniel Graña
parent c1cb418dee
commit b566388122
1 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class BaseSgmlLinkExtractor(FixedSGMLParser):
link.url = link.url.encode(response_encoding)
link.url = urljoin(base_url, link.url)
link.url = safe_url_string(link.url, response_encoding)
link.text = str_to_unicode(link.text, response_encoding, errors='replace')
link.text = str_to_unicode(link.text, response_encoding, errors='replace').strip()
ret.append(link)
return ret
@ -79,7 +79,7 @@ class BaseSgmlLinkExtractor(FixedSGMLParser):
def handle_data(self, data):
if self.current_link:
self.current_link.text = self.current_link.text + data.strip()
self.current_link.text = self.current_link.text + data
def matches(self, url):
"""This extractor matches with any url, since