This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// orginally used for scraping a specification table. Rename function as you like. | |
// WARNING: This is a mix of es5 and es6. Take care with older browsers! | |
function getSpecs(col1, col2) { | |
var keys = []; | |
var val = []; | |
var result = {}; | |
// + build the arrays | |
for(var i=0; i < document.querySelectorAll(col1).length; i++) { | |
// Everything passed .nodeValue is to clean up any spaces. You don't want spaces in your keys if you can help it |