diff --git a/changedetectionio/content_fetchers/res/stock-not-in-stock.js b/changedetectionio/content_fetchers/res/stock-not-in-stock.js index df33fbe6..373c669e 100644 --- a/changedetectionio/content_fetchers/res/stock-not-in-stock.js +++ b/changedetectionio/content_fetchers/res/stock-not-in-stock.js @@ -154,10 +154,14 @@ function isItemInStock() { } elementText = ""; - if (element.tagName.toLowerCase() === "input") { - elementText = element.value.toLowerCase().trim(); - } else { - elementText = getElementBaseText(element); + try { + if (element.tagName.toLowerCase() === "input") { + elementText = element.value.toLowerCase().trim(); + } else { + elementText = getElementBaseText(element); + } + } catch (e) { + console.warn('stock-not-in-stock.js scraper - handling element for gettext failed', e); } if (elementText.length) {