Document doc = Jsoup.parse(pResponse);
Elements vTransactionElements =
doc.getElementById("balanceForm:transactionPostList").select("tbody tr");
for (Element element : vTransactionElements) {
Transaction vTransaction = new Transaction();
Elements vTransactionElement = element.select("td");
vTransaction.setAmount(new BigDecimal(vTransactionElement.get(1).text()
.replaceAll("[^\\d-]", "")));
vTransaction.setDescription(vTransactionElement.get(2).text());
if (!vTransaction.hasDescription()) {
vTransaction
.setDescription(vTransaction.getAmount().compareTo(BigDecimal.ZERO) > 0 ? "Insättning"
: "Uttag");
}
vTransaction.setCurrency(Currency.getInstance("SEK"));
vTransaction.setTransactionDate(new LocalDate(vTransactionElement.first().text()));
vTransactions.add(vTransaction);
}
return vTransactions;
}