Perlbeginner1 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Perl :: Mechanize - running a single while loop

Replies are listed 'Best First'.
Re: Perl :: Mechanize - running a single while loop
by Corion (Patriarch) on May 19, 2011 at 18:51 UTC

    No. The data is copyrighted even though it is made available freely: "Downloading or copying of texts, illustrations, photos or any other data does not entail any transfer of rights on the content." (and again, in German, as you've been scraping some other German list to spam before).

    Please contact the Federal Chancellery for a bulk transfer of the data instead of scraping it.

Re: Perl :: Mechanize - running a single while loop
by Anonymous Monk on May 19, 2011 at 18:58 UTC
    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

      Hello dear Friend,

      many thanks for the good ideas and hints! You raise valid points. Many thanks i will try to figure out all the necessary steps. Your posting helps alot!

      greetings

      pb1