On Wed, 31 Jul 2002 21:50:45 -0400 David Gerler <[EMAIL PROTECTED]>
wrote:
> I have Perl & LWP, but can't find a reference to following a link with a
> target.
>
> I have a getpage sub that works for all links except this one:
>
> <a href="//ftp.thesite.com/default.asp?memno=69361" target="_blank">
>
> When my sub gets this link, it returns a 500 error.
>
> This is my sub:
>
> sub getpage {
>
> my $url = $_[0];
> my $ua = $_[1];
>
> if ($url !~ /https\:/){
> $url = "https\:".$url;
> }
>
> my $req = HTTP::Request->new(GET => $url, $headers);
> my $response = $ua->request($req);
>
> return $response;
> }
>
> How do I make the ua "spawn" an new ua with that link?
What's in $url? It should only contain the href part. You can use
HTML::Parser to correctly find and parse HTML tags.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.