How to download file after button click with no URL

49 views
Skip to first unread message

Toplek

unread,
Jan 4, 2012, 3:17:33 AM1/4/12
to WWW::Mechanize users
HI,

I'm trying to download file with no success using below code:

$mech = WWW::Mechanize::Frames->new(stack_depth => 0, autocheck => 1,
noproxy => 1 );
$mech->get( $search_result );
$mech->form_number( 4 );

$mech->current_form()->click("eksport_do_pliku");
print $mech->res();

This is part of HTML source:
"
<button type="submit" name="eksport_do_pliku" class="buty"
style="margin-left:20px"
onclick="document.getElementById('cod').value='2';"><img src="gfx/
przyciski/akceptuj.png" style="vertical-align:middle;margin-right:
5px">Eksportuj dane do pliku </button>
"

The result of "$mech->res();" is "HTTP::Response=HASH(0x8a49d10)"

Please help :)
Reply all
Reply to author
Forward
0 new messages