Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi, Okay, coming rather late (about a year) to the discussion...

I can't bear to see a thread go unfinished, especially when I've blatantly copied the original poster's code and edited it into working (the example web site used below is of personal interest to me and my loved ones):

#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Request; use HTML::TableExtract; my $ua = LWP::UserAgent->new(timeout => 10); my $url = 'http://sourceforge.net/tracker/?atid=440764&group_id=36855& +func=browse'; my $request = HTTP::Request->new('GET',$url); my $response = $ua->request($request); if ($response->is_success){ my $te = new HTML::TableExtract( headers => ['Request ID','Summary +'] ); $te->parse($response->content); foreach my $ts ($te->table_states) { foreach my $row ($ts->rows) { print (join("\t", @$row)."\n"); } } } else { print "Error: ".$response->status_line."\n"; }
N.B. this node isn't worth ++ing; it would only encourage this kind of behaviour :-)

Tim


In reply to Re: Using HTML::TableExtract by tfrayner
in thread Using HTML::TableExtract by RayRay459

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-19 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found