Skip to content

Instantly share code, notes, and snippets.

@fenomenog4
Created September 24, 2012 13:47
Show Gist options
  • Save fenomenog4/3776036 to your computer and use it in GitHub Desktop.
Save fenomenog4/3776036 to your computer and use it in GitHub Desktop.
Cliente de formulario de login simple con mechanize
require 'rubygems'
require 'mechanize'
a = Mechanize.new
a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
a.get('http://sau/module.php/core/authenticate.php?as=sau') do |login_page|
# Submit the login form
my_page = login_page.form_with(:name => 'f') do |f|
f.username = '******@grammata.es'
f.password = '******'
end.submit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment