Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Skip header and footer rows on recent items |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
d3dd5434069e8047402d2521a4719a09 |
User & Date: | atomicules 2015-06-28 10:59:05 |
Context
2015-07-01
| ||
11:34 | Add basics for writing out transactions in Ledger format check-in: 16678c4f5f user: atomicules tags: trunk | |
2015-06-28
| ||
10:59 | Skip header and footer rows on recent items check-in: d3dd543406 user: atomicules tags: trunk | |
2015-06-27
| ||
20:20 | Actual initial commit of file check-in: 649373d472 user: atomicules tags: trunk | |
Changes
Changes to smile.rb.
︙ | ︙ | |||
43 44 45 46 47 48 49 | page = a.click(page.link_with(:text => "current account")) #recent items doc = Nokogiri::HTML(page.body) #Look for summaryTable rows = doc.xpath("//table[@class='summaryTable']//tr") #Do something with that! | < < > > > > | | | | | > > > > | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | page = a.click(page.link_with(:text => "current account")) #recent items doc = Nokogiri::HTML(page.body) #Look for summaryTable rows = doc.xpath("//table[@class='summaryTable']//tr") #Do something with that! #array of hashes? transactions = [] #Skip first row (ths) rows = rows[1..-1] rows.each do |row| #Skip last row, maybe unless row.elements.length == 1 date = row.elements[0].text name = row.elements[1].text credit = row.elements[2].text debit = row.elements[3].text transactions << { :date => date, :name => name, :credit => credit, :debit => debit} end end #TODO: Need to figure out a way to get input for number of previous pages required. Well, a good way, perhaps limit by a date? puts "Enter date back to fetch transactions to" #Assume ISO thingy format date_limit = gets.strip #.convert_to_date #Previous statements page = a.click(page.link_with(:text => "previous statements")) #TODO: Then need to click the top most page and go back through each page. |