Hi,
I use LWP::UserAgent to "grab" a web page put it in a temp file and parsing some data with regular expression.
But every page that I grab have not the same format that if I check the source code of the page. On every line I've at least one "sqare" (when I check with Notepad).
So my regular expression doesn't work anymore. I really don't know what to do to solve this issue.
There's my code :
Thanks
Patrick
I use LWP::UserAgent to "grab" a web page put it in a temp file and parsing some data with regular expression.
But every page that I grab have not the same format that if I check the source code of the page. On every line I've at least one "sqare" (when I check with Notepad).
So my regular expression doesn't work anymore. I really don't know what to do to solve this issue.
There's my code :
Code:
use LWP::UserAgent;
use HTTP::Request;
use strict;
$|++;
my $ua = LWP::UserAgent->new(agent=>'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.12) Gecko/20050919 Firefox/1.0.7');
$ua->default_headers->header('Content-Type' => 'text/html');
my $req = new HTTP::Request('GET', '[URL unfurl="true"]http://www.yahoo.com')[/URL] || die ("$! $url_part");
my $res = $ua->request($req, 'Temp.html');
Thanks
Patrick