scrapedData = {
const scrapedData = [];
const cols = $(options.class + " tr:nth-child(" + options.fields + ") td");
let colnames = [];
cols.each((index, element) => {
colnames.push($(element).text());
});
colnames[0] = "country";
$(options.class + " tr").each((index, element) => {
if (index <= options.start - 1) return true;
if (index >= $(options.class + " tr").length - options.end) return true;
const tds = $(element).find("td");
let row = {};
for (let i = 0; i < colnames.length; i++) {
row = Object.assign(row, { [colnames[i]]: $(tds[i]).text() });
}
scrapedData.push(row);
});
return scrapedData;
}