fix: preserve original key structure
This commit is contained in:
@@ -229,11 +229,11 @@ window.scrapeSchema = function (lists) {
|
||||
|
||||
return MBEs.map((mbe) => omap(
|
||||
lists,
|
||||
({ selector }) => {
|
||||
({ selector }, key) => {
|
||||
const elem = Array.from(document.querySelectorAll(selector)).find((elem) => mbe.contains(elem));
|
||||
return elem ? elem.innerText : undefined;
|
||||
},
|
||||
(key) => lists[key].selector // Use the selector as the key in the output
|
||||
(key) => key // Use the original key in the output
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user