diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index ce051920..9544a950 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -61,6 +61,10 @@ class PageUnloadable(Exception): self.message = message return +class BrowserStepsInUnsupportedFetcher(Exception): + def __init__(self, url): + self.url = url + return class EmptyReply(Exception): def __init__(self, status_code, url, screenshot=None): @@ -712,6 +716,9 @@ class html_requests(Fetcher): current_include_filters=None, is_binary=False): + if self.browser_steps_get_valid_steps(): + raise BrowserStepsInUnsupportedFetcher(url=url) + # Make requests use a more modern looking user-agent if not {k.lower(): v for k, v in request_headers.items()}.get('user-agent', None): request_headers['User-Agent'] = os.getenv("DEFAULT_SETTINGS_HEADERS_USERAGENT", diff --git a/changedetectionio/update_worker.py b/changedetectionio/update_worker.py index 46984089..fee6a5a2 100644 --- a/changedetectionio/update_worker.py +++ b/changedetectionio/update_worker.py @@ -430,6 +430,12 @@ class update_worker(threading.Thread): 'last_check_status': e.status_code, 'has_ldjson_price_data': None}) process_changedetection_results = False + except content_fetcher.BrowserStepsInUnsupportedFetcher as e: + err_text = "This watch has Browser Steps configured and so it cannot run with the 'Basic fast Plaintext/HTTP Client', either remove the Browser Steps or select a Chrome fetcher." + self.datastore.update_watch(uuid=uuid, update_obj={'last_error': err_text}) + process_changedetection_results = False + logger.error(f"Exception (BrowserStepsInUnsupportedFetcher) reached processing watch UUID: {uuid}") + except UnableToExtractRestockData as e: # Usually when fetcher.instock_data returns empty logger.error(f"Exception (UnableToExtractRestockData) reached processing watch UUID: {uuid}")