From: | "Joachim Misselbeck" <joachim.misselbeck [...] mplusw.net> |
To: | <bug-WWW-Mechanize [...] rt.cpan.org> |
Subject: | Question |
Date: | Sun, 31 Jul 2005 07:29:37 +0200 |
Hi,
first thx for this Module with great functions.
Today I write a little script to visit a Website, but I get some error
Message from your lib's.
I try with WWW-Mechanize::Shell and all thinks good, but If I use the script
(created with the shell command script)
so I get Errors and the Script ends.
Here the generated Script:
#!/usr/bin/perl -w
use strict;
use WWW::Mechanize;
use WWW::Mechanize::FormFiller;
use URI::URL;
use Date::Calc qw(:all);
my $agent = WWW::Mechanize->new( autocheck => 1 );
my $formfiller = WWW::Mechanize::FormFiller->new();
my $day = 0;
my $month = 0;
my $year = 0;
($year,$month,$day) = &Today();
$day = "0".$day if($day < 10);
$month = "0".$month if($month < 10);
my ($year2,$month2,$yesterday) = Add_Delta_Days($year,$month,$day, -1);
$yesterday = "0".$yesterday if($yesterday < 10);
print "$day.$month.$year\n";
print "$yesterday.$month.$year\n";
$agent->env_proxy();
$agent->get('[URL=http://www.xxx-yyy.de']http://www.xxx-yyy.de'[/URL]);
$agent->form(1) if $agent->forms and scalar@{$agent->forms};
$agent->form_number(1);
$formfiller->add_filler( 'usrusr' => Fixed => 'vvv' );
$formfiller->add_filler( 'usrpwd' => Fixed => 'nnnnn' );
$formfiller->fill_form($agent->current_form);
$agent->click('usrannounce');
$agent->follow(qr((?-xism:ERWEITERTES)));
$agent->follow(qr((?-xism:Suchmaske)));
$agent->form_number(2);
$formfiller->add_filler( 'snNr' => Fixed => '' );
$formfiller->add_filler( 'jahr' => Fixed => 'ALL' );
$formfiller->add_filler( 'colliNr' => Fixed => '' );
$formfiller->add_filler( 'bordNr' => Fixed => '' );
$formfiller->add_filler( 'datVonwdat' => Fixed => "$yesterday" );
$formfiller->add_filler( 'datBiswdat' => Fixed => "$day" );
$formfiller->add_filler( 'datArt' => Fixed => 'sdgdat' );
$formfiller->add_filler( 'status' => Fixed => 'all' );
$formfiller->add_filler( 'stati' => Fixed => '' );
$formfiller->add_filler( 'statSel' => Fixed => 'pos' );
$formfiller->add_filler( 'quitt' => Fixed => 'all' );
$formfiller->add_filler( 'absNme' => Fixed => '' );
$formfiller->add_filler( 'refNr' => Fixed => '' );
$formfiller->add_filler( 'kdNr' => Fixed => '' );
$formfiller->add_filler( 'verid' => Fixed => 'ALL' );
$formfiller->add_filler( 'empfNme' => Fixed => '' );
$formfiller->add_filler( 'empfLand' => Fixed => '' );
$formfiller->add_filler( 'empfPlz' => Fixed => '' );
$formfiller->add_filler( 'empfOrt' => Fixed => '' );
$formfiller->add_filler( 'pagesize' => Fixed => '100' );
$formfiller->add_filler( 'sort' => Fixed => 'sorted' );
$formfiller->add_filler( '' => Fixed => '' );
$formfiller->fill_form($agent->current_form);
$agent->click('search');
#$agent->form_number(2);
$agent->follow(qr((?-xism:\bemail\b)));
$agent->form_number(1);
$agent->click('usrlogout');
and the Error-Message:
Use of uninitialized value in exists at
/usr/lib/perl5/site_perl/5.8.1/WWW/Mechanize/FormFiller.pm line 96.
Use of uninitialized value in hash element at
/usr/lib/perl5/site_perl/5.8.1/WWW/Mechanize/FormFiller.pm line 97.
Can't find any link matching (?-xism:(?-xism:versenden)) on this page
(http://www.xxx-yyy.de/index.asp) at
/mnt/daten/Versandmeldungen_steinle/fetch_steinle.pl line 68
The Website used a lot of Java-Scripts, but with Shell all o.k.
Have you any Idear?
Mit freundlichen GrĂ¼ssen / Best Regards
Joachim Misselbeck
It's nice to be important, but important to be nice !