From 85715120e2e3c432059035c755c190c3505ed1e4 Mon Sep 17 00:00:00 2001 From: Michael <75951847+michael-kerbel@users.noreply.github.com> Date: Sat, 19 Feb 2022 13:40:57 +0100 Subject: [PATCH] XPath RegularExpression support --- changedetectionio/html_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changedetectionio/html_tools.py b/changedetectionio/html_tools.py index 7a6b91c6..47b7f698 100644 --- a/changedetectionio/html_tools.py +++ b/changedetectionio/html_tools.py @@ -25,7 +25,7 @@ def xpath_filter(xpath_filter, html_content): tree = html.fromstring(html_content) html_block = "" - for item in tree.xpath(xpath_filter.strip()): + for item in tree.xpath(xpath_filter.strip(), namespaces={'re':'http://exslt.org/regular-expressions'}): html_block+= etree.tostring(item, pretty_print=True).decode('utf-8')+"
" return html_block