use WWW::Mechanize::PhantomJS; my $mech = WWW::Mechanize::PhantomJS->new(); $mech->get('https://profile.ccli.com/account/signin?appContext=OLR&returnUrl=https%3A%2F%2Freporting.ccli.com%2F'); $mech->field( EmailAddress => 'me@test.com' ); $mech->field( Password => 'mypw' ); # This doesn't seem to work $mech->click_button( id => 'sign-in' ); # Each of these didn't work either, so I've commented them out #$mech->click_button( number => 1 ); #$mech->click({ xpath => '//button' }); #$mech->submit_form(); # This didn't work either, so I've commented it out #$mech->submit_form( # with_fields => { # EmailAddress => 'me@test.com', # Password => 'mypw' # } #); $mech->render_content( format => 'png', filename => 'ccli_login.png' );