Changing module bahavior WWW::Mechanize
- From: David Harmon <source@xxxxxxxxxx>
- Date: Sun, 27 Apr 2008 16:59:09 -0700
So I want to fetch some web pages and then grab some image files they
refer to. The images are linked with the standard <img src="... html
tag. WWW::Mechanize is perfect for that, except that the links it
scans for do not include image tags. Hunting in Mechanize.pm I find
the list it uses, which is:
my %urltags = (
a => "href",
area => "href",
frame => "src",
iframe => "src",
);
If I add one line to that, everything works like I want it too:
img => "src",
But I don't really want to modify my copy of Mechanize! My code
won't work on any other installation. Every time I installed a
updated version, I would have to fix it again (well, that would be
seldom, but.)
What to do? Is there a legitimate way to pass that request to
Mechanize?
Oh and, what do I know, I tried the following in my code and I am not
sure why it didn't work:
$WWW::Mechanize::urltags{'img'} = "src";
..
.
- Follow-Ups:
- Re: Changing module bahavior WWW::Mechanize
- From: Joost Diepenmaat
- Re: Changing module bahavior WWW::Mechanize
- From: Gunnar Hjalmarsson
- Re: Changing module bahavior WWW::Mechanize
- Prev by Date: Re: Regex for "at start of line OR preceded by space".
- Next by Date: use perl to draw Venn Diagram
- Previous by thread: FAQ 3.5 How do I debug my Perl programs?
- Next by thread: Re: Changing module bahavior WWW::Mechanize
- Index(es):