Arik123 has asked for the wisdom of the Perl Monks concerning the following question:
I do something like
$mech = new WWW::Mechanize; $mech->get("http://domain.com/page"); print $mech->base;
It prints 'http://domain.com/page' although the page contains the line <base href="http://domain.com/">. As a result, all the (relative) links are broken:
for ($mech->links) { print $_->url_abs, "\n"; }
prints things like "http://domain.com/page/page2" instead of "http://domain.com/page2"
Any way to fix it, without the need to regex the page myself for the Base tag?
Thanks!
Back to
Seekers of Perl Wisdom