I have a perl script that navigates through two form pages on a website in order to download the result of final form submission to a file. This page is very large and I'd rather write it directly to disk instead of having the whole thing sitting in memory.
Here's a code snippet:
$mech->submit_form(
form_name => 'search',
fields => {
"srch_recd" => $cfg{max_rows}, #results per page
}
);
$mech->save_content( $workdir.$cfg{cachedstones} );
I know that I can do this:
$mech->get( $url, ":content_file"=>$tempfile );
in order to have the result go to a file when using get(). However, doing the same hasn't worked for submit_form().
How can I get the result of a submit_form() to go into a fiel directly, rather than sit in memory?