From 6658980b5be1b73d25e8a2e807b9b4d1b628a061 Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Fri, 23 Jun 2023 22:51:37 +0200 Subject: [PATCH 1/2] fix(JS): `selectors` is a Set with size, not length Docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set --- scraper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scraper.js b/scraper.js index aa17758..ec9a231 100644 --- a/scraper.js +++ b/scraper.js @@ -81,7 +81,7 @@ class Scraper { matches[selector] = nodeCompleteTexts }) - return selectors.length === 1 ? matches[selectors[0]] : matches + return selectors.size === 1 ? matches[selectors[0]] : matches } async getAttribute(attribute) { From 570d083d9dd1ca3e6a9c474b053e7c693c38a73d Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Sat, 24 Jun 2023 03:49:38 +0200 Subject: [PATCH 2/2] fix(logic): was always failing - simplify --- scraper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scraper.js b/scraper.js index ec9a231..ccc519e 100644 --- a/scraper.js +++ b/scraper.js @@ -81,7 +81,7 @@ class Scraper { matches[selector] = nodeCompleteTexts }) - return selectors.size === 1 ? matches[selectors[0]] : matches + return matches } async getAttribute(attribute) {