Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
My program starts at the following url: http://www.dhl-usa.com/TransitTimes/USTTimeStart.asp?nav=TransitTimes after I have it enter the zip codes (53213, 60056) and go to the next page, the url is
http://www.dhl-usa.com/TransitTimes/USTTimeRslts.asp?nav=TransitTimes& +oz=53213&oc=1&oh=ORD&dz=60056&dc=1&dt=1/6/2006&tt=1&hy=&zn=2&am=Y

How do I do a search (and print) the number of days in transit (in this case "1"). Every search I try seems to come up without finding the phrase. The immediate phrase of the HTML that the "1" is in <div class="pL5">1 is repeated 17 times in this page, but that may vary. I tried to do a search on the paragraph of HTML code that contains the "1" that I need:

DHL Ground Service</a> <br> (Letter &#150; 150 Pounds)</div></td> + <td><div class="pL5">Monday,&nbsp;Jan&nbsp;9,&nbsp;2006 &n +bsp;By end of day<img src="http://www.dhl-usa.com/images/blank.gif" w +idth="1" height="1"></div></td> <td><div class="pL5">1
, but it won't find it. I'm just using
if( $mech->content =~ m{WHAT I'M SEARCHING FOR COPIED FROM THE SOURCE +CODE}) { print "Ground Service is available";
Any suggestions?

Edit: g0n - code tags around long url


In reply to searching a webpage 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!
  • 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, 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
  • 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.
  • 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 contemplating the Monastery: (6)
    As of 2021-04-11 22:46 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?