Ich nutze das Modul WWW::Mechanize um Webseiten abzufragen. Dies geschieht in einer Schleife ungefähr 100 mal.
Leider bricht das Programm immer mal wieder ab und es kommt folgende Ausgabe:
Error GETing http://www.abc.org/test.php: Can't connect to www.abc.org:80 (Bad hostname 'www.abc.org') at attwarn.pl line 67
Kann ich dies irgendwie abfangen???
Hier ein kleiner Ausschnitt des Quellcodes:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
while ($ende > $a)
{
sleep($sek);
if ($mech->get( "http://www.abc.org/test.php" ))
{
if ( $mech->content =~ /xy/m )
{
open (AUSGABE, ">>log.txt");
print AUSGABE datum()." : TEST!";
close (AUSGABE);
}
else
{
open (AUSGABE, ">>log.txt");
print AUSGABE datum()." : TEST2";
close (AUSGABE);
}
}