Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save betzerra/6cd88a7ee61f49ff6748a07f73acca90 to your computer and use it in GitHub Desktop.
Save betzerra/6cd88a7ee61f49ff6748a07f73acca90 to your computer and use it in GitHub Desktop.
santander.rb
require 'faraday'
require 'nokogiri'
response = Faraday.new.get 'https://www.santander.com.ar/ConectorPortalStore/Rendimiento'
html = Nokogiri::HTML(response.body)
desired_items = [
'SUPER AHORRO $ CUOTA A',
'SUPER AHORRO PLUS CUOTA A',
'SUPERGESTION MIX VI CUOTA A'
]
list = {}
html.css('tr').each do |row|
row_description = row.css('table tr td').text
# ignore items that doesn't contain desired_items
next unless desired_items.any? { |i| row_description.include?(i) }
key = row_description.strip
item_entry = {
value: row.css('td')[3].text,
daily: row.css('td')[4].text,
last_30_days: row.css('td')[5].text,
last_90_days: row.css('td')[6].text,
last_year: row.css('td')[7].text
}
list[key] = item_entry
end
puts list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment