CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Testing & fetching specific html tag



Mar 1, 2002, 6:10 AM

Post #1 of 1 (530 views)
Testing & fetching specific html tag Can't Post

already couple of days I'm trying to figure out...
I was trying fetching html and I had lines to fetch them via while $line(@html)....
But because some lines (CR) finishes before paragraph finishes it cuts in half of the sentence...
What is a proper way to print out all text between <BR> tags (if it has HH:MM - string) ? I need an good way to have variable which will store text in between each <br> tag and print the line + I'll check if that <br> (token) contains time stamp, which is:
24 hour format 01-24 than it has column and minutes.
Other <br> tags I do not need.
Up to now I finished with this code:
$url = $ENV{'QUERY_STRING'};
$html = get($url);
$breakup1= "01:";
$breakup2= "02:";
# or $breakup0 = "([0-9]+\:[0-9]+)";
$html = join("\n", @html);

while (($html =~ s/(.*?)<br>//si) && ($html =~ /$breakup1/ || $html =~ /$breakup2/ )) #...and so on
# or while (($html =~ s/(.*?)<br>//si) && ($html =~ /$breakup0/))
print $html;

I know this is not working, what I need is
test for breakups in <br> tokens and put it together so
if <br> (token) has time stamp to print it out.

I have good knowledge of XSL and in XSL is very easy
to grab tag but for this I need CGI.

Thanks a lot.

(This post was edited by Ned on Mar 1, 2002, 6:43 AM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives