mirror of https://github.com/scrapy/scrapy.git
RegexLinkExtractor: add \x0c to whitespace characters, as per html5 standard
This commit is contained in:
parent
e1ceaf3b5f
commit
ad36a4a6ae
|
|
@ -10,9 +10,10 @@ linkre = re.compile(
|
|||
"<a\s.*?href=(\"[.#]+?\"|\'[.#]+?\'|[^\s]+?)(>|\s.*?>)(.*?)<[/ ]?a>",
|
||||
re.DOTALL | re.IGNORECASE)
|
||||
|
||||
|
||||
def clean_link(link_text):
|
||||
"""Remove leading and trailing whitespace and punctuation"""
|
||||
return link_text.strip("\t\r\n '\"")
|
||||
return link_text.strip("\t\r\n '\"\x0c")
|
||||
|
||||
|
||||
class RegexLinkExtractor(SgmlLinkExtractor):
|
||||
|
|
|
|||
Loading…
Reference in New Issue