Does a memory-efficient alternative exist that writes the content to files and incrementally parses the content?

I ran into a similar problem a while back. I wrote WWW::Crawler::Lite as a result. You supply the `on_response` handler which you could use to do anything you want (write the response to disk, parse later/incrementally, etc). You'll be starting a bit closer to the ground on this one (compared to WWW::Mechanize) but its memory footprint is tiny compared to 'Mech.

You can see an example spider which crawls search.cpan.org in the t/ folder of the module http://cpansearch.perl.org/src/JOHND/WWW-Crawler-Lite-0.003/t/010-basic/


In reply to Re: Are there any memory-efficient web scrapers? by jdrago999
in thread Are there any memory-efficient web scrapers? by Anonymous Monk

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.