Skip to content

Instantly share code, notes, and snippets.

@akkez
Created May 1, 2016 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akkez/53e5b44c47805dba1abc41b44a8683ad to your computer and use it in GitHub Desktop.
Save akkez/53e5b44c47805dba1abc41b44a8683ad to your computer and use it in GitHub Desktop.
// заходим на страницу с историей операций и вставляем скрипт в консоль
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