Advertisement
Guest User

Untitled

a guest
Nov 12th, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. require 'mechanize'
  2. require 'nokogiri'
  3.  
  4. agent = Mechanize.new
  5.  
  6.  
  7. for i in 10221780..17888735
  8. page = agent.get('http://pocae.tstgo.cl/PortalCAE-WAR-MODULE/')
  9. form = agent.page.forms.first
  10. form.NomDominio = 'aft.cl'
  11. form.NomHost = 'AFT'
  12. form.NomUsuario = 'usuInternet'
  13. form.NumDistribuidor = 99
  14. form.NumTarjeta = i
  15. form.RutUsuario = 0
  16. form.Trx = ''
  17. form.accion = 6
  18. form.bloqueable = ''
  19. html = agent.submit(form)
  20. page = Nokogiri::HTML(html.body)
  21. saldo = page.css("table")[4].css("td[class=verdanabold-ckc]")[5].text
  22. puts "Nro BIP: %{nro}" % { nro: i }
  23. puts "Saldo: %{saldo}" % { saldo: saldo }
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement