Commit 782e081d authored by Vincent A's avatar Vincent A Committed by Romain Bignon

weboob.browser.filters.html: add AbsoluteLink filter

parent 1d0714f1
......@@ -19,9 +19,10 @@
import lxml.html as html
from .standard import _Selector, _NO_DEFAULT, Filter, FilterError
from import html2text
from import basestring, unicode
from import basestring, unicode, urljoin
__all__ = ['CSS', 'XPath', 'XPathNotFound', 'AttributeNotFound',
......@@ -76,6 +77,14 @@ class Link(Attr):
super(Link, self).__init__(selector, 'href', default=default)
class AbsoluteLink(Link):
def __call__(self, item):
ret = super(AbsoluteLink, self).__call__(item)
if ret:
ret = urljoin(, ret)
return ret
class CleanHTML(Filter):
def filter(self, txt):
if isinstance(txt, (tuple, list)):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment