Something like
GetSome( starting url ); sub GetSome { my $mech ... my @pages = ... while(@pages) { my $page = shift @pages; $mech->get( $page ); push @pages, GetMorePages( $mech ); SomethingImportant( $mech ); SomethingXPATH( $mech ); } }
combine with Re: Help With Online Table Scraper.

All the interesting stuff happens in GetMorePages, SomethingImportant, and SomethingXPATH

Can you give me a hint for the beginning - the processing of the entry pages - doing this in Perl:: Mechanize

Before writing any code, make a nice flowchart, maybe with Text::Flowchart, of how you think your program should work.

Once you have an overall idea of how your program should work, once you have the skeleton (like I outlined above), then think about writing some code (like the skeleton).

Next part is to write a small program in the spirit of Re^5: WWW::Mechanize clicking checkboxes or Re^2: Help With Online Table Scraper (or Re^2: Printing just the file name for all the cases), to solve one part of your diagram, like GetMorePages.

Then incorporate GetMorePages into your main program, and then repeat these steps for some other part, like SomethingXPATH

And repeat until you're finished


In reply to Re: Perl :: Mechanize - running a single while loop by Anonymous Monk
in thread Perl :: Mechanize - running a single while loop by Perlbeginner1

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.