Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- getting full URL from relative links
April 19, 2010, 3:51 pm
rate this thread
Hi, I'm trying to get full/absolute URLs from relative links in HTML
documents. I've been trying to fudge this using File::Basename,
WWW::Mechanize, etc. but was wondering if there's a more ready-made
way to do this.
For example, if my main doc is:
and it contains a relative link to:
how do I get the absolute URL to "yourdoc.html"? Using the above
modules I've been able to get:
when what I want is:
Of course I could try and parse all of the possible variations for
relative paths, but it's making my head hurt and I was wondering if
there's a module that could help with this. Any thoughts would be
- » FAQ 3.21 How can I compile my Perl program into byte code or C?
- — Next thread in » PERL Discussions