From 11efe2d85dc50b60ddcfa00b31e223ff3ac62ea1 Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Mon, 24 Feb 2014 20:09:28 +0100 Subject: [PATCH] add **kwargs to manage extra args in xpath and cssselect --- weboob/tools/parsers/lxmlparser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weboob/tools/parsers/lxmlparser.py b/weboob/tools/parsers/lxmlparser.py index 9e0e54fa..f2449cbf 100644 --- a/weboob/tools/parsers/lxmlparser.py +++ b/weboob/tools/parsers/lxmlparser.py @@ -60,7 +60,7 @@ class LxmlParser(IParser): return self.tocleanstring(doc) @classmethod - def select(cls, element, selector, nb=None, method='cssselect'): + def select(cls, element, selector, nb=None, method='cssselect', **kwargs): """ Select one or many elements from an element, using lxml cssselect by default. @@ -78,9 +78,9 @@ class LxmlParser(IParser): :rtype: Element """ if method == 'cssselect': - results = element.cssselect(selector) + results = element.cssselect(selector, **kwargs) elif method == 'xpath': - results = element.xpath(selector) + results = element.xpath(selector, **kwargs) else: raise NotImplementedError('Only the cssselect and xpath methods are supported') if nb is None: