I am using WWW :: Mechanize :: Shell for testing.
my code is:
#!/usr/bin/perl use WWW::Mechanize; use HTTP::Cookies; my $url = "http://mysite/app/login.jsp"; my $username = "username"; my $password = "asdfasdf"; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_number(1); $mech->field(j_username => $username); $mech->field(j_password => $password); $mech->click(); $mech->follow_link(text => "LINK A", n => 1); $mech->follow_link(text => "LINK B", n => 1);
........................ ........................ .. ...................... etc. etc.
The problem is as follows:
LINK B (web_page_b.html), redirect to web_page_x.html
if I print the contents of $ mech-> content (), display web_page_b.html
but I need to display web_page_x.html to automatically submit the HTML form (web_page_x.html)
The question arises:
How can I get web_page_x.html?
thanks
source share