Re: anyone know why extract_links() isn't working?

Harald Joerg (Harald.Joerg@mch.sni.de)
Fri, 31 Oct 1997 09:58:48 +0100


Matt Silvia wrote:
> I'm having trouble getting the extract_links() method of
> HTML::TreeBuilder to work.
> [...explanation code deleted...]

My first observation was that your code works on my PC with
just two lines added:

use LWP::UserAgent;
use HTML::Parse;

It does however, extract just one link from the page I selected,
which contained my mail address. Which is as much as what was to
be expected, since the URL I entered was not prepared for a
POST request, and the page contained an error message created
by the server which contains my mail address as the only link.
   Which leads me to the simple suggestion:
replace
    my $req = new HTTP::Request POST => $URL;
with
    my $req = new HTTP::Request GET => $URL;
if you don't have anything to POST to.
--
Oook,
--haj--