Re: turning relative into absolute urls

From: gnari (gnari_at_simnet.is)
Date: 02/11/04


Date: Wed, 11 Feb 2004 21:18:53 -0000


"Felix" <google_answers@festmail.com> wrote in message
news:62dd5c5b.0402111254.7931e39a@posting.google.com...
> Hi -
>
> I need a perl function ("make_absolute")that turns all relative URLs
> in an html document into absolute URLs, using the URL from which the
> document was fetched as an argument (see script below), and then
> returns the updated, entire html document.
>
> I fiddled with Perl classes like URI and HTML:Parsner but wasn't able
> to get it right. Thanks a bunch.

I think it would be more productive, if you told us in what way you
were not able to get it right with these. I am sure a lot of people here
will gladly (gleefully, even) point out what you are doing wrong.

do you need a general solution working with any valid HTML,
or is the HTML structure a known and simple structure, that
regexes would be able to handle?

gnari



Relevant Pages

  • Re: turning relative into absolute urls
    ... > in an html document into absolute URLs, using the URL from which the ... > returns the updated, entire html document. ... A sentence should contain no unnecessary words, a paragraph no unnecessary sentences, for the same reason that a drawing should have no unnecessary lines and a machine no unnecessary parts." ...
    (comp.lang.perl.misc)
  • turning relative into absolute urls
    ... I need a perl function that turns all relative URLs ... in an html document into absolute URLs, using the URL from which the ... document was fetched as an argument (see script below), ... returns the updated, entire html document. ...
    (comp.lang.perl.misc)