#!/usr/bin/perl -w use strict; use warnings; use WWW::Mechanize; my $start_url = 'http://www.start_url.gt'; my $loginUrl = "https://www.hallo_welt.gt/login.do"; my ($mech,$response,$data); $mech = WWW::Mechanize -> new ( quiet => 1 ); $response = $mech -> get ($loginUrl); if (defined $response) { $data = $response -> content; $response = $mech -> form_number (1); $mech -> field ('userName','username'); $mech -> field ('password','password'); # usw. für jedes Feld $response = $mech -> submit_form (); if (defined $response) { $data = $response -> content; $response = $mech -> get ($start_url); if (defined $response) { $data = $response -> content; print "Bin drin:\n*****\n$data\n*****\n"; } else { die "Bekomme die Start-URL nicht\n"; } } else { die "Login fehlgeschlagen!\n"; } } else { die "$start_url ist nicht erreichbar\n"; }