Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// заходим на страницу с историей операций и вставляем скрипт в консоль
var content = "Время;Провайдер;Счет;Комментарий;+/-;Сумма;Комиссия\n";
$(".reports .reportsLine").each(function (k, a) {
var row = [];
var date = $(a).find(".DateWithTransaction");
row.push(date.find(".date").text().trim() + " " + date.find(".time").text().trim());
var comment = $(a).find(".ProvWithComment");
row.push(comment.find(".provider span:eq(0)").text());
row.push(comment.find(".provider span:eq(1)").text());
row.push(comment.find(".comment").text());
var block = $(a).find(".IncomeWithExpend");
var sign = "-";
if (block.hasClass("income")) {
sign = "+";
}
row.push(sign);
var cash = block.find(".cash").text().trim().replace(/[\r\n\t\s]+/g, "");
var fee = block.find(".commission").text().trim().replace(/[\r\n\t\s]+/g, "");
row.push(cash);
row.push(fee);
if (row.join("").length < 3) {
return;
}
content += row.join(";") + "\n";
});
console.log(content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.