cwchang has asked for the wisdom of the Perl Monks concerning the following question:
------------------------------------- Does anyone know how to automatically save the returned data file? Thanks a lot! J#!/usr/bin/perl -w use strict; $|++; use WWW::Mechanize; my $ticker = shift; #UserAgent settings my $agent = WWW::Mechanize->new(); push @{$agent->requests_redirectable}, 'POST'; $agent->cookie_jar(HTTP::Cookies->new(file => "../../run/lwpcookies.tx +t", autosave => 1)); #Grabbing the front page $agent->get( "http://www.cboe.com/DelayedQuote/QuoteTableDownload.aspx +" ); $agent->success or die $agent->response->status_line; #Login $agent->form_name("QuoteTableDownload"); $agent->field("ticker", "INTC"); $agent->submit(); $agent->success or die $agent->response->status_line; open (OUT, "> ./tmp.html"); print OUT $agent->content; close OUT;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: save file from POST form??
by tachyon (Chancellor) on Sep 30, 2004 at 02:23 UTC |