Monastery, I need help with Mechanize firefox module.I am trying to download a usage file and I have automated to the point where I get a prompt for Opening "file" dialog with two radio buttons open (selected) and save file. I am trying to execute a java-script that will select the save file radio button and then the ok button, but I don't seem to find out how to do that. Any ideas on how to execute the javascript from within my code? Currently my code looks like this:
my $agent = WWW::Mechanize::Firefox->new(autoclose => 0); $agent->get($url); # check if page has a login cached page if ($cached) { $agent->form_number('1'); $agent->field(j_username=>$username); $agent->field(j_password=>$password); $agent->submit(); die unless ($agent->success); } else { #Now we retrieve the download page for downloading usage records. my $usagepage="$url$usagelink"; $agent->get($usagepage); $agent->form_name($usageform); $agent->field("#dateFrom",$datefrom); $agent->field("#dateTo",$dateto); #this now brings out the download prompt dialog box # and requires action $agent->eval_in_page('doExport();); # Need to now obtain file somehow... die unless ($agent->success);
Any help or direction is greatly appreciated.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |