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 Pounds)</div></td>
+
<td><div class="pL5">Monday, Jan 9, 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
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.