Skip to content

Instantly share code, notes, and snippets.

@geronimod
Created May 1, 2012 19:03
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 geronimod/2570527 to your computer and use it in GitHub Desktop.
Save geronimod/2570527 to your computer and use it in GitHub Desktop.
GWT mechanize login test
# require 'rubygems'
require 'mechanize'
bot = Mechanize.new
bot.log = $stdout
bot.get('https://www.google.com/webmasters/tools') do |login_page|
home_page = login_page.form_with(:action => /ServiceLoginAuth/) do |f|
f.field_with(:name => 'Email').value = 'reporting@ninebyblue.com'
f.field_with(:name => 'Passwd').value = '{the correct pass}'
end.click_button
puts home_page.body
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment