I added a print statement to $row and i can see what i am looking for(this is an excerpt from my console when the line print $row is executed):#!/usr/bin/perl use HTTP::Request; use HTTP::Headers; use LWP::UserAgent; my(@ListingsUrls, $req, $ua, $responsecode, $res, $row, $url); $ua = LWP::UserAgent->new; $url = "http://listings.test.com/aw/listings/list/category12"; $request = new HTTP::Request('GET',$url); $ua->timeout(10); $response = $ua->request($request); my $responsecode = $response->code(); next if $responsecode != 200; @ARRAY_OF_LINES = (split "\n", $ua->request($request)->as_stri +ng); $request->as_string; foreach $row (@ARRAY_OF_LINES) { chomp($row); print $row . "\n"; } if ($row =~ (/Updated\s*:\s*\w+\s*-\s*\d{1,2}:\d{1,2}\d{1,2}\s +* PST/)){ print $1; }else{ print "html didn't contain Updated"; }
Any advice would be greatly appreciated.<tr> <td> <p></p><br> <center> <font face="Arial, Helvetica" size="-1"> <b>Updated: Mar-11 23:05:50 PST</b>
In reply to Re: my code error-ing out trying to grab html
by RayRay459
in thread my code error-ing out trying to grab html
by RayRay459
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |