Thread LWP::UserAgent & redirection (2 answers)
Opened by conray at 2011-02-06 21:14

conray
 2011-02-06 23:31
#145408 #145408
User since
2010-02-19
52 Artikel
BenutzerIn
[default_avatar]
Erledigt!
Habs endlich rausgefunden:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
                my $request = HTTP::Request->new('HEAD', $link);
                $request->header('Accept' => 'text/html');
                my $response = $ua->request($request);
                if ($response->is_success) 
                {
                        my $url = $response->request()->uri();
                        logger( "### Found new URL: " . $url );
                        push(@urls, $url);
                }


mfg
conray

View full thread LWP::UserAgent & redirection