Skip to content

Instantly share code, notes, and snippets.

@EldonMcGuinness
Created January 10, 2018 06:11
Show Gist options
  • Save EldonMcGuinness/2c45ba1e8a177dd4371402924c09d3c6 to your computer and use it in GitHub Desktop.
Save EldonMcGuinness/2c45ba1e8a177dd4371402924c09d3c6 to your computer and use it in GitHub Desktop.
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
function strip(str) {
return str.replace(/^\s+|\s+$/g, '');
}
var json = {};
var productArray = Array();
$.each($('.plist'), function(k,v){
var a = $(v).find('.plistname').text().trim();
var b = $(v).find('.plistbtm h4').text().replace('Price: ','').trim();
productArray.push(Array(a,b));
});
JSON.stringify(productArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment