Dear Monks

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
use WWW:Mechanize use Storable; $url = 'website'; $m = WWW:mechanize->new(); $m->get($url); my @LINKS = $m->find_all_links(url_regex => qr/$string/i);

Much Appreciated

Dan ;)


In reply to Navigating Multiple links on a webpage and collecting the HTML information with WWW:Mechanize by fraizerangus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.