[Chicago-talk] Downloading a file via WWW::Mechanize
Jay Strauss
me at heyjay.com
Sat Oct 2 12:16:23 CDT 2004
Andy Lester wrote:
>>
>> I know your trying to help. But all the examples, the cookbook, the
>> docs talk about having a url to get. I'm not doing a "get", I'm
>> doing a "post". I can't supply |:content_file option.|
>
>
> And once you post, and it sends you a file back, it's in your
> $agent->content. Write that out to a file.
>
> xoa
>
Isn't that what I'm doing with my original posting of my code??
#!/usr/bin/perl
use WWW::Mechanize;
my $url = "http://www.cboe.com/DelayedQuote/QuoteTableDownload.aspx";
my $mech = WWW::Mechanize->new();
$mech->get( $url );
my $res = $mech->submit_form(
form_number => 1,
fields => {ticker => 'QQQ'},
);
print $mech->content;
More information about the Chicago-talk
mailing list