Skip to content

Instantly share code, notes, and snippets.

@sh-sabbir
Last active October 2, 2021 16:17
Show Gist options
  • Save sh-sabbir/3a82a41251de12f4d299fd1a09ca4705 to your computer and use it in GitHub Desktop.
Save sh-sabbir/3a82a41251de12f4d299fd1a09ca4705 to your computer and use it in GitHub Desktop.
var tables = document.getElementsByClassName('geotable');
var data = {};
for (var i = 0; i < tables.length; i++) {
var rows = tables.item(i).rows;
var localArray = [];
for (j = 0; j < rows.length; j++){
var oCells = rows.item(j).cells;
var ups = oCells.item(1).getElementsByTagName('a');
var upsArray = [];
for (k = 0; k < ups.length; k++){
upsArray.push(ups.item(k).text);
}
localArray[oCells.item(0).innerText] = upsArray;
}
Object.assign(data,localArray);
}
console.log(JSON.stringify(data));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment