From: Alex Young Date: 2006-06-19T16:53:03+09:00 Subject: Re: Looking for Mechanize code for login Jim Freeze wrote: > 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? 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. -- Alex