yantar has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I am working on generating a report for a customer. I can get this report from a web page i can access. First i will need to fill a form with my user name, password and choose a server from a drop down list, and log in. Second i need to click a link for the report section. Third a need to fill a form to create the report.

Here is what i wrote so far:

my $mech = WWW::Mechanize->new(); my $url = 'http://X.X.X.X/Console/login/login.aspx'; $mech->get( $url ); $mech->submit_form( form_number => 1, fields =>{ 'ctl00$ctl00$cphVeriC +entre$cphLogin$txtUser' => 'someone', 'ctl00$ctl00$cphVeriCentre$cphL +ogin$txtPW' => '12345', 'ctl00$ctl00$cphVeriCentre$cphLogin$ddlServer +s' => 'Live', button => 'Sign-In' }, ); die unless ($mech->success); $mech->dump_forms();
I dont understand why, but, after this i look at the what dump outputs and i see the code for the first login page, while i belive i should have reached the next page after my successful login.

Could there be something with a cookie that can effect me and the login attempt?

Anythings else i am doing wrong? Appreciate you help, Yaniv

Replies are listed 'Best First'.
Re: Cant get www:Mechanize to work
by Corion (Patriarch) on Jun 09, 2009 at 10:46 UTC

    You already got answers on how to debug HTTP interaction in your previous post, using and debuging www Mechanize. What problems do you have when following these steps?

      I answered in that thread but got no replay.
      You can see the data there.

      Thank you!

        This is not a code writing service. If you mean Re^10: using and debuging www Mechanize, you already have the headers. Now you have to find the difference between the two sets of headers. As long as there are differences, you will need to eliminate them. I haven't looked at your post to find the differences, as I expect you to be able to print out two lists and strike off matching items yourself.