Last active
December 14, 2015 18:39
-
-
Save pedroaxl/5131294 to your computer and use it in GitHub Desktop.
robô para ficar acessando o portal do aluno e ver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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