chore: lint
This commit is contained in:
@@ -132,12 +132,12 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3,
|
|||||||
*/
|
*/
|
||||||
// Wrap the entire function in an IIFE (Immediately Invoked Function Expression)
|
// Wrap the entire function in an IIFE (Immediately Invoked Function Expression)
|
||||||
// and attach it to the window object
|
// and attach it to the window object
|
||||||
(function(window) {
|
(function (window) {
|
||||||
/**
|
/**
|
||||||
* Returns a "scrape" result from the current page.
|
* Returns a "scrape" result from the current page.
|
||||||
* @returns {Array<Object>} *Curated* array of scraped information (with sparse rows removed)
|
* @returns {Array<Object>} *Curated* array of scraped information (with sparse rows removed)
|
||||||
*/
|
*/
|
||||||
window.scrape = function(selector = null) {
|
window.scrape = function (selector = null) {
|
||||||
/**
|
/**
|
||||||
* **crudeRecords** contains uncurated rundowns of "scrapable" elements
|
* **crudeRecords** contains uncurated rundowns of "scrapable" elements
|
||||||
* @type {Array<Object>}
|
* @type {Array<Object>}
|
||||||
@@ -182,13 +182,13 @@ function scrapableHeuristics(maxCountPerPage = 50, minArea = 20000, scrolls = 3,
|
|||||||
return crudeRecords;
|
return crudeRecords;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given an object with named lists of elements,
|
* Given an object with named lists of elements,
|
||||||
* groups the elements by their distance in the DOM tree.
|
* groups the elements by their distance in the DOM tree.
|
||||||
* @param {Object.<string, {selector: string, tag: string}>} lists The named lists of HTML elements.
|
* @param {Object.<string, {selector: string, tag: string}>} lists The named lists of HTML elements.
|
||||||
* @returns {Array.<Object.<string, string>>}
|
* @returns {Array.<Object.<string, string>>}
|
||||||
*/
|
*/
|
||||||
window.scrapeSchema = function (lists) {
|
window.scrapeSchema = function (lists) {
|
||||||
function omap(object, f, kf = (x) => x) {
|
function omap(object, f, kf = (x) => x) {
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
Object.entries(object)
|
Object.entries(object)
|
||||||
@@ -235,6 +235,6 @@ window.scrapeSchema = function (lists) {
|
|||||||
},
|
},
|
||||||
(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