$content = $mech->content() contains only the first 8192 bytes

51 views
Skip to first unread message

ron vennes

unread,
Jun 4, 2013, 1:39:29 PM6/4/13
to www-mecha...@googlegroups.com
At the end of the script after POST, $content only holds the first 8192 bytes of the page.  Viewing the same page in Chrome shows that it is indeed stopping on the first 8192 bytes of a 25k page.  MaxLineLength and MaxHeaderLength doesn't seem to have any effect (probably cause I'm using it wrong), also tried setting both to zero.  The <header> is pretty big on this page (lots of jsp), it's kinda suspicious that it's stopping on an even byte boundary.

<code>
#!/usr/bin/perl
use CSV;
use WWW::Mechanize;

my %OPTS = @LWP::Protocol::http::EXTRA_SOCK_OPTS; 
$OPTS{MaxLineLength} = 102400; # Or however large is needed... 
$OPTS{MaxHeaderLength} = 102400; # Or however large is needed... 
@LWP::Protocol::http::EXTRA_SOCK_OPTS = %OPTS; 

use strict;

# Start Mech and get it ready

my $mech = WWW::Mechanize->new( cookie_jar => {},activate => 0,autoclose => 1,autodie =>0 );

$mech->get( $startPage ); 

my $content = $mech->content();

# Sign in...
$mech->form_name( 'entryForm' );
$mech->submit_form(
        with_fields => {
            'userid' => "abcdefg",
            'pw' => "123456",      
        },
    );

$content = $mech->content();

$mech->follow_link( url_regex => qr/requestframe/i );
$startPage = "requestcost.jsp";
$mech->get( $startPage ); 
$content = $mech->content();

'whatToDo' => "add",
'whereFrom' => "requestframe.jsp",
'whereTo' => "onerequest.jsp",
);

sleep(2);

$content = $mech->content();

exit;

</code>
Reply all
Reply to author
Forward
0 new messages