Skip to content

Instantly share code, notes, and snippets.

@pedroaxl
Last active December 14, 2015 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedroaxl/5131294 to your computer and use it in GitHub Desktop.
Save pedroaxl/5131294 to your computer and use it in GitHub Desktop.
robô para ficar acessando o portal do aluno e ver
require 'watir-webdriver'
b = Watir::Browser.new :chrome
busy = true
while busy
puts "sleeping"
sleep 10
puts "accessing page"
b.goto 'http://www.ufrgs.br/ufrgs/aluno'
puts "filling form"
form = b.div(:id => 'login').forms.first
form.text_field(:id => 'cartao').set '171267'
puts "submitting"
form.submit
busy = b.alert.present?
puts "still busy" if busy
b.alert.ok if busy
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment