From: Bil Kleb Date: 2007-05-05T10:35:08+09:00 Subject: Re: Need advice for a script to scrap my Verizon account Steve wrote: > I am new to Ruby. I would like to write a script that will login to > my Verizon account and grab my minute details and calculate my > remaining unused minutes for the month. I just did something similar for our electronic time sheet -- I had to negotiate a frameset, viz, URL = 'https://site.somewhere.gov/' require 'rubygems'; require 'mechanize' agent = WWW::Mechanize.new form = agent.get("#{URL}").forms.name('loginForm').first form.userid = ARGV[0] # 1st commandline argument form.password = ARGV[1] # 2nd " " frame = agent.submit(form).frames.name('Main').href form = agent.get("#{URL}/#{frame}").forms.name('timeCard').first form.ENTRY_24378_1_3 = '2.25' # set hours for 1st week, 3rd day agent.submit(form) The next step was to use Hpricot to scrape the relations of table inputs to time codes, but I haven't gotten there yet... Regards, -- Bil Kleb http://fun3d.larc.nasa.gov