I'm going to start by pasting my current code.
var array1 = [741, 451, 54188, 5847, 5418, 54944, 310, 541, 7451, 10211, 113, 9115, 62, 2841, 52482481, 24];
var array2 = [15, 418, 488, 130000, 8482, 55, 16, 14, 2546, 651, 4521, 11, 54, 659, 542, 1152];
var myObj = {};
array1.forEach(function(item, i) {
myObj[item] = array2[i];
});
I want to try and write a function that will modify the URL for each element of array1. This URL would be like
http://blahblahblah.com/blah/
EachElementToBeScanned/cost
My intention would be for it to scan through the list of them, and then...
I have some Regex to run on that page it finds (see below).
Finally, I want to see if the value that the webpage gives for each element in array1 is less than or equal to the corresponding one in array2.
This is the purpose of myObj.
Here is my Regex, which I believe is already fine:
var someRegex = /\<span class="cost-in-usd">([\d,]+)\<\/span\>/
var costOfIt = data.match(Regex)[1]
costOfIt = Number(costOfIt.replace(",",""))