Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Your script has many errors in it, it looks like you copy/pasted several things together. Please run your script before posting so we can concentrate on the problem part. That being said, the following works:
use strict; use LWP::Simple; use HTML::TableExtract; my $page = get("http://www.dhl-usa.com/TransitTimes/USTTimeRslts.asp?n +av=TransitTimes&oz=53213&oc=1&oh=ORD&dz=60056&dc=1&dt=1/9/2006&tt=1&h +y=&zn=2&am=Y"); my $te = HTML::TableExtract->new( depth => 3, count => 3); $te->parse($page); foreach my $ts ($te->table_states) { foreach my $row ($ts->rows) { print join(',', @$row), "\n"; } } __OUTPUT__ Service,Arrival Date and Time,Days in Transit* DHL Next Day 10:30 am (Letter ű 150 Pounds),Tuesday,áJaná10,á2006 áBy 10:30 A.M.,1 DHL Next Day 12:00 pm (Letter ű 150 Pounds),Tuesday,áJaná10,á2006 áBy Noon,1 DHL Next Day 3:00 pm (Letter ű 150 Pounds),Tuesday,áJaná10,á2006 áBy 3:00 P.M.,1 DHL 2nd Day Service (Letter ű 150 Pounds),Wednesday,áJaná11,á2006 áBy 5:00 P.M.,2 DHL Ground Service (Letter ű 150 Pounds),Tuesday,áJaná10,á2006 áBy end of day,1

In reply to Re: Problems with TableExtract by johnnywang
in thread Problems with TableExtract by bcdeery

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (5)
    As of 2014-11-29 05:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (203 votes), past polls