Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'mechanize'
- require 'nokogiri'
- agent = Mechanize.new
- for i in 10221780..17888735
- page = agent.get('http://pocae.tstgo.cl/PortalCAE-WAR-MODULE/')
- form = agent.page.forms.first
- form.NomDominio = 'aft.cl'
- form.NomHost = 'AFT'
- form.NomUsuario = 'usuInternet'
- form.NumDistribuidor = 99
- form.NumTarjeta = i
- form.RutUsuario = 0
- form.Trx = ''
- form.accion = 6
- form.bloqueable = ''
- html = agent.submit(form)
- page = Nokogiri::HTML(html.body)
- saldo = page.css("table")[4].css("td[class=verdanabold-ckc]")[5].text
- puts "Nro BIP: %{nro}" % { nro: i }
- puts "Saldo: %{saldo}" % { saldo: saldo }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement