$agent->requests_redirectable( [] );
This seems to successfully capture the redirect URL and outputs the following (actual long hex strings and other info replaced with 'X'):$post_response = $agent->click('continue'); my $status = $agent->status(); if (($status >= 300) && ($status < 400)) { my $location = $agent->response()->header('Location'); if (defined $location) { print "Redirected to $location\n"; $post_response = $agent->get(URI->new_abs($location, $agent->b +ase())); printf("post_response is %s\n", $post_response->status_line); } }
However I can tell from my program that is isn't successfully navigating to the final screen of the process, because when I run:Redirected to /misc/XXXX/processocp.cgi?email=XXXX&back=httpXXXXX&spla +sh=X&vskey=XXXX post_response is 200 OK
I get (again, the info in the redirect URL has been replaced with 'X'):$post_response->decoded_content()
<!DOCTYPE html> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="content-type"> <meta http-equiv="refresh" content="1;url=http://XXXX/processocp.cgi?e +mail=XXXXX&back=XXXXXX&vskey=XXXXX"> </head> <body> <div style="font-size: 1.5em; text-align: center; width: 300px; margin +: 0px auto; margin-top: 40px"> Processing...please wait<br/> </div> </body> </html>
In reply to Re^3: redirection issue with WWW::Mechanize
by Special_K
in thread redirection issue with WWW::Mechanize
by Special_K
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |