[Chicago-talk] Downloading a file via WWW::Mechanize
Jay Strauss
me at heyjay.com
Fri Oct 1 23:58:07 CDT 2004
Andy Lester wrote:
>>> Can I download a file via WWW::Mechanize? Specifically I'm trying
>>> to get quotes from the CBOE site. They now offer a comma separated
>>> file, available for download.
>>>
>> Helloooooooo, anyone out there?
>
>
> I figure if I wait long enough, you'll read the docs.
>
> xoa
>
Andy,
I just don't see how to do it in my instance, I can't use $mech->get
because its not a uri, its a form I need to fill out, then push the
download button, after which I download a form.
I've been messing with the below to no avail
#!/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