From e6173357a9a07c817625af8ca52baa03dbb75fa7 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 28 Jul 2022 09:19:10 +0200 Subject: [PATCH] Visual Selector direct element finder fix --- changedetectionio/content_fetcher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index ca43edc8..90988179 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -63,12 +63,12 @@ class Fetcher(): break; } if('' !==r.id) { - chained_css.unshift("#"+r.id); - final_selector= chained_css.join('>'); + chained_css.unshift("#"+CSS.escape(r.id)); + final_selector= chained_css.join(' > '); // Be sure theres only one, some sites have multiples of the same ID tag :-( if (window.document.querySelectorAll(final_selector).length ==1 ) { return final_selector; - } + } return null; } else { chained_css.unshift(r.tagName.toLowerCase());