Looking for Mechanize code for login

Hi

I am trying to automate collecting balances from my bank using
Mechanize.
I have set

#!/usr/bin/env ruby

require ‘rubygems’
require ‘mechanize’
require ‘pp’

username = “*****”
password = “****”

site_url = “https://online.compassweb.com/servlet/compass/login.jsp
agent = WWW::Mechanize.new
page = agent.get(site_url)
form = page.forms.first
form.fields.name(“UserName”).value = username
form.fields.name(“Password”).value = password
page = agent.submit(form, form.buttons.first)

The page I get back has the following in it:

Can someone tell me what the process is for retrieving pages like
this are?

Thanks

Jim F.

Jim F. wrote:

Can someone tell me what the process is for retrieving pages like this are?
If that’s all you ever get back, I’d say to first do the login to get
the cookies, check that you get what you’re expecting back, then just
directly agent.get that url.

There’s a much easier way … buy Quicken :). Or reverse-engineer
Gnucash, if it works with your bank. :slight_smile:

Alex Y. wrote:

require ‘mechanize’
form.fields.name(“Password”).value = password

Can someone tell me what the process is for retrieving pages like
this are?
If that’s all you ever get back, I’d say to first do the login to get
the cookies, check that you get what you’re expecting back, then just
directly agent.get that url.


M. Edward (Ed) Borasky