Skip to content

Instantly share code, notes, and snippets.

@denysonique
Created October 7, 2011 17:20
Show Gist options
  • Save denysonique/1270832 to your computer and use it in GitHub Desktop.
Save denysonique/1270832 to your computer and use it in GitHub Desktop.
require 'mechanize'
require 'shellwords'
agent = Mechanize.new
agent.user_agent_alias = 'Windows IE 7'
page = agent.get('https://online.lloydstsb.co.uk/personal/logon/login.jsp')
login_form = page.forms.first
login_form.send("frmLogin:strCustomerLogin_userID", "1234")
login_form.send("frmLogin:strCustomerLogin_pwd", "secret")
page = agent.submit login_form
puts %x[echo #{page.content.shellescape} | lynx -dump -stdin]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment