Sep 28, 2011, 6:13 AM
Post #1 of 1
Navigating Multiple links on a webpage and collecting the HTML information with WWW:Mechanize
Please help, I've spent the last 2 weeks trying to write code which will allow me to select several similar links from an internet homepage, follow each of them and then follow several more similar links in these and then copying the HTML from these pages (creating a web browsing tree I suppose). I've been trying to grapple with WWW:Mechanize, which seems to work well with linear web progression but I can't find a way to itertae and have it follow multiple similar links on the same page more than once? Does anyone have any code or ideas on the best way to go about doing this?!
heres what I've got so far
$url = 'website';
$m = WWW:mechanize->new();
$m->get($url); my @LINKS = $m->find_all_links(url_regex => qr/$string/i);