So call it like this:sub meta_refresh { my $mech = shift; my $expected_url = shift; my $url; if($mech->content() =~ /<meta http-equiv="refresh" content="0;url= +([^"]*)"/) { $url = $1; } cmp_ok($expected_url, 'eq', $url, "The meta refresh returns the ex +pected URL"); $mech->get( $expected_url ); ok($mech->success(), "URL loaded successfully"); }
# Code to cause the refresh to appear not shown. # Check the refresh and follow meta_refresh($mech, '/index.cgi?rm=home');
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: WWW::Mechanize follow meta refreshes
by merlyn (Sage) on Apr 13, 2005 at 14:38 UTC | |
by simon.proctor (Vicar) on Apr 13, 2005 at 15:42 UTC | |
Re: WWW::Mechanize follow meta refreshes
by Kanji (Parson) on Apr 14, 2005 at 15:19 UTC | |
by simon.proctor (Vicar) on Apr 15, 2005 at 09:00 UTC | |
Re: WWW::Mechanize follow meta refreshes
by jbrugger (Parson) on Apr 14, 2005 at 06:10 UTC | |
Re: WWW::Mechanize follow meta refreshes
by mhi (Friar) on Aug 28, 2005 at 20:46 UTC |