See Re: Help With Online Table Scraper, Re: Formating a HTML document to show certain text.
$ lwp-download "http://perlmonks.com/?abspart=1;displaytype=displaycode;node_id=934485;part=1" junk.html
281 bytes received
HTML::Element=HASH(0xb31bcc) 0.1.0
John.Martines
/html/body/a
/html/body/a
/html/body/a[@href='page.aspx?a=c4bc46eswsdw32fcc']
------------------------------------------------------------------
HTML::Element=HASH(0xb31d2c) 0.1.1.0.0
Mary Jones
/html/body/ul/li/a
/html/body/ul/li/a
/html/body/ul/li/a[@href='page.aspx?a=0a2b-a99d-3754eb2f5e35']
------------------------------------------------------------------
HTML::Element=HASH(0xb31e0c) 0.1.1.1.0
Fernando Praderas
/html/body/ul/li[2]/a
/html/body/ul/li[2]/a
/html/body/ul/li[2]/a[@href='page.aspx?a=1ef7b100-8dc4-4b40-871c-68b1d
+0']
------------------------------------------------------------------
##################################################################
HTML::Query use HTML::Query qw{ Query };
print "$_\n" for Query(
file => q{junk.html}
)->query(
q{a[href~=page.aspx]}
)->as_text ;
__END__
John.Martines
Mary Jones
Fernando Praderas
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|