From 13aabd48dbf19a3fb4ff53165ad386dd5f6d70e8 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 22 May 2022 22:07:45 +0200 Subject: [PATCH] more tweaks --- changedetectionio/__init__.py | 2 +- changedetectionio/content_fetcher.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 0f8ab736..87485361 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -612,7 +612,7 @@ def changedetection_app(config=None, datastore_o=None): has_empty_checktime=using_default_check_time, using_global_webdriver_wait=default['webdriver_delay'] is None, current_base_url=datastore.data['settings']['application']['base_url'], - emailprefix=os.getenv('NOTIFICATION_MAIL_BUTTON_PREFIX', False) + emailprefix=os.getenv('NOTIFICATION_MAIL_BUTTON_PREFIX', False), ) return output diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index 0d4c16c6..d5933d45 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -47,7 +47,7 @@ class Fetcher(): if('' !==r.id) { chained_css.unshift("#"+r.id); final_selector= chained_css.join('>'); - # be sure theres only one + // 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; } @@ -63,7 +63,7 @@ class Fetcher(): // @todo - if it's SVG or IMG, go into image diff mode - var elements = window.document.querySelectorAll("div,span,form,table,tbody,tr,td,a,p,ul,li,h1,h2,h3,h4"); + var elements = window.document.querySelectorAll("div,span,form,table,tbody,tr,td,a,p,ul,li,h1,h2,h3,h4, header, footer, section, article, aside, details, main, nav, section, summary"); var size_pos=[]; // after page fetch, inject this JS // build a map of all elements and their positions (maybe that only include text?) @@ -72,7 +72,7 @@ class Fetcher(): bbox = elements[i].getBoundingClientRect(); // forget really small ones - if (bbox['width'] <10 && bbox['height'] <10 ) { + if (bbox['width'] <20 && bbox['height'] < 20 ) { continue; }