Hi, I have a very simple WWW::Mechanize perl program which does the following task. 1. Gets the login URL. 2. Enters username and password. 3. Get another URL. 4. Fill some fields of date range and submit. 5. Parse the content and create a report.
It used to work until the web designer changed the form fields, added some javascript and the program stopped working. So I changed my program(basically the form fields), but I am unable to get the *content* in #4. Infact the content is same as the content of #3. After googling, reading the docs, trying out things for hours, I am unable to crack it :((. Following are the form fields which I get from the program. Which seems identical to the fields in the html source. option: orderdaterangeinputstore:st : 14 option: orderdaterangeinputstore:star : 01 option: orderdaterangeinputstore:sta : 2006 option: orderdaterangeinputstore:end : 15 option: orderdaterangeinputstore:endm : 01 option: orderdaterangeinputstore:endy : 2006 submit: orderdaterangeinputstore:_id11 : hidden: orderdaterangeinputstore:merchantID : 100106 hidden: orderdaterangeinputstore:statusID : 2109 hidden: jsf_tree_64 : <very_long_string_hash> hidden: jsf_state_64 : <very_long_string_hash> hidden: jsf_viewid : /merchant/merchantDateRange.jsp hidden: orderdaterangeinputstore_SUBMIT : 1 hidden: orderdaterangeinputstore:_link_hidden_ : Following is the code and I have attached the html source of #3. use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $url = "login_url"; $mech->get($url); $mech->set_fields( '_id0:_id8' => 'user', '_id0:_id12' => 'password' ); $mech->click(); $mech->get('another_url'); $mech->set_fields( 'orderdaterangeinputstore:endy' => 2006, 'orderdaterangeinputstore:endm' => '01', 'orderdaterangeinputstore:end' => 15, 'orderdaterangeinputstore:sta' => 2006, 'orderdaterangeinputstore:star' => '01', 'orderdaterangeinputstore:st' => 14 ); $mech->click(); print $mech->content; --Ankur
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>