chore: lint
This commit is contained in:
@@ -230,24 +230,24 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3,
|
|||||||
return MBEs.map((mbe) => omap(
|
return MBEs.map((mbe) => omap(
|
||||||
lists,
|
lists,
|
||||||
({ selector, attribute }, key) => {
|
({ selector, attribute }, key) => {
|
||||||
const elem = Array.from(document.querySelectorAll(selector)).find((elem) => mbe.contains(elem));
|
const elem = Array.from(document.querySelectorAll(selector)).find((elem) => mbe.contains(elem));
|
||||||
if (!elem) return undefined;
|
if (!elem) return undefined;
|
||||||
|
|
||||||
switch (attribute) {
|
switch (attribute) {
|
||||||
case 'href':
|
case 'href':
|
||||||
return elem.getAttribute('href');
|
return elem.getAttribute('href');
|
||||||
case 'src':
|
case 'src':
|
||||||
return elem.getAttribute('src');
|
return elem.getAttribute('src');
|
||||||
case 'innerText':
|
case 'innerText':
|
||||||
return elem.innerText;
|
return elem.innerText;
|
||||||
case 'textContent':
|
case 'textContent':
|
||||||
return elem.textContent;
|
return elem.textContent;
|
||||||
default:
|
default:
|
||||||
return elem.innerText;
|
return elem.innerText;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(key) => key // Use the original key in the output
|
(key) => key // Use the original key in the output
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
})(window);
|
})(window);
|
||||||
Reference in New Issue
Block a user