I use wget to download the file at the end of the URL (a web page) and write it to a file, then I open the file and read through it with a while loop one line at a time.

Next time, show us some of your code -- it's just better that way.

So you'll start using LWP or LWP::Simple (and I'm not surprised you didn't find them... I still have trouble remembering how these module names relate to their function, let alone what "LWP" actually stands for).

After that, the next thing you'll want to get acquainted with is the more appropriately named HTML::Parser. This will help tremendously in doing a proper job of whatever it is you are trying to do with the web pages that you are downloading -- and you won't even need to store the html data to a file first (though you probably want to do that anyway), because HTML::Parser can work directly on the scalar variable that holds the full content of the page (after LWP assigns the fetched web-page content to that variable). Good luck.


In reply to Re: From bash to perl by graff
in thread From bash to perl by paranoid times

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.