I just wrote something like this. THe LWP::Simple is great for getting the page. To split out the URL's I used the HTML::TokeParser Which is great for going through a document and grabbing our the URLS. In my code I had to be able to use the Text and the URL This is a chunk of the program to demo. this will just print a list of links from a web site.
#!/usr/bin/perl -w use strict; use HTML::TokeParser; use LWP::Simple; my $page=get ('http:web.site.here/file.html'); unless (defined ($page)) {die "Unable to retrive page:$!\n";} my @links; #multi demantional array to hold links my $cnt = 0; my $p = HTML::TokeParser->new(\$page); while (my $token = $p->get_tag("a")) { my $url = $token->[1]{href} || "-"; my $text = $p->get_trimmed_text("/a"); $links[$cnt][0] = $text; $links[$cnt][1] = $url; $cnt++; } #sample of accessing links array $cnt =0; my $size = @links; while ($cnt < $size) { print "Text:$links[$cnt][0]\tURL:$links[$cnt][1]\n"; $cnt++; } exit();
Ps. I am always open to suggestions. I'm still pretty new

In reply to Re: web page source? by Desdinova
in thread web page source? by cheetahpimp

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.