I am using WWW::Mechanize for my inhouse project. Earlier I asked some question in WWW::Mechanize - Could not connect to a server and I got clarification from that node replies. Also there is a recent node which discusses about web forms in Submit HTML Forms with WWW:Mechanize. I picked up some code from there and used in my code, but I did not get any from names.
If I try to get google page I am getting value in the webforms arrary. If I use my application URL I am not getting that. Am I missing still something in the code ? will there be any web page without web forms ? Just curious to know.#!/usr/bin/perl use WWW::Mechanize ; use LWP::Debug qw(+); use strict; use warnings; use Data::Dumper; #use LWP::UserAgent; my $mech = WWW::Mechanize->new ; #my $ua = LWP::UserAgent->new; $mech->proxy(['http','ftp'], 'http://proxy_ip_dress:port_number/'); $mech ->get("http://application_ip_address:8082/root/Login") ; if ( $mech ->success ) { print "Connection Success ", $mech ->res->st +atus_line, "\n"; } else { print "Status :" , $mech ->res->status_line +, "\n"; } my @webforms = $mech->forms(); print Dumper [ @webforms ]; # @webforms is empty foreach my $form (@webforms) { my @inputfields = $form->param; foreach my $inputfield (@inputfields) { print Dumper [ $inputfield ]; } print Dumper [ $form ]; }
In reply to In a Web Page forms are displayed as empty by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |