var setInterval function var btn button last contains Ранее table-body

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
var a=[], b =[], d = [], r = [], i = setInterval(function(){
var btn = $(".button:last:contains(Ранее)");
$(".table-body .profit,.table-body .loss").each(function(i,e){a.push(parseFloat($(this).text().replace(",","")))});
$(".table-body .grd-show-mobile + .grd-grid-3").each(function(i,e){b.push(parseFloat($(this).text().replace(",","")))});
$(".table-body .grd-grid-6:contains(2014)").each(function(i,e){d.push(($(this).text()))});
if( btn.is(":visible") ) {
getEventListeners(btn[0]).click[0].listener({});
} else {
clearInterval(i);
a.reverse(); d.reverse(); b.reverse();
for(i=-1;++i<a.length;) {r.push(b[i] + "\t" + a[i] + "\t" + d[i]);};
var w = window.open("about:blank");
w.document.body.innerHTML = "<textarea id='t' cols='200' rows='50'>"+r.join("\n")+"</textarea>";
w.document.getElementById("t").focus();
w.document.getElementById("t").select();
}
}, 2500);