Fixed #49. Bump to 0.6.0.4

This commit is contained in:
Yuri Baburov 2015-07-27 10:06:28 +06:00
parent c51886d923
commit fcdbe563a5
2 changed files with 9 additions and 2 deletions

View File

@ -110,7 +110,14 @@ class Document:
doc = html_cleaner.clean_html(doc) doc = html_cleaner.clean_html(doc)
base_href = self.url base_href = self.url
if base_href: if base_href:
doc.make_links_absolute(base_href, resolve_base_href=True) # trying to guard against bad links like <a href="http://[http://...">
try:
# such support is added in lxml 3.3.0
doc.make_links_absolute(base_href, resolve_base_href=True, handle_failures='discard')
except TypeError: #make_links_absolute() got an unexpected keyword argument 'handle_failures'
# then we have lxml < 3.3.0
# please upgrade to lxml >= 3.3.0 if you're failing here!
doc.make_links_absolute(base_href, resolve_base_href=True)
else: else:
doc.resolve_base_href() doc.resolve_base_href()
return doc return doc

View File

@ -14,7 +14,7 @@ if sys.platform == 'darwin':
setup( setup(
name="readability-lxml", name="readability-lxml",
version="0.6.0.3", version="0.6.0.4",
author="Yuri Baburov", author="Yuri Baburov",
author_email="burchik@gmail.com", author_email="burchik@gmail.com",
description="fast python port of arc90's readability tool", description="fast python port of arc90's readability tool",