G
Guest
I am trying to use a proxy the same proxy works fine in ie6/firefox but for
some strange reason I get an uninitialised value when using the proxy in ANY
perl script, the code to use the proxy is:
use strict;
use warnings;
use LWP:
ebug qw(+);
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
my $url =
http://news.google.co.uk/search?q=~...0&hl=en&safe=off&start=0&as_qdr=all&filter=0;
$mech->proxy('http','http://127.0.0.1:8088');
$mech->get($url);
my @links_to_check = grep { $_->url() !~ /google/i}
$mech->find_all_links( url_regex => qr/\./i );
foreach my $links_to_check (@links_to_check)
{
print "$links_to_check \n";
}
with LWP:
ebug qw(+) I receive
LWP::UserAgent::new: () LWP::UserAgent:
roxy: http http://127.0.0.1:8088
LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking
news.google.co.uk for cookies HTTP::Cookies::add_cookie_header: Checking
..google.co.uk for cookies HTTP::Cookies::add_cookie_header: Checking
google.co.uk for cookies HTTP::Cookies::add_cookie_header: Checking .co.uk
for cookies HTTP::Cookies::add_cookie_header: Checking co.uk for cookies
HTTP::Cookies::add_cookie_header: Checking .uk for cookies
LWP::UserAgent::send_request: GET
http://news.google.co.uk/search?q=~...00&hl=en&safe=off&start=0&as_qdr=all&filter=0
LWP::UserAgent::_need_proxy: Proxied to http://127.0.0.1:8088
LWP:
rotocol::http::request: () LWP:
rotocol::collect: read 130 bytes
LWP::UserAgent::request: Simple response: Not Found Use of uninitialized
value in concatenation (.) or string at movien1.pl line 28. 0 news items
found
some strange reason I get an uninitialised value when using the proxy in ANY
perl script, the code to use the proxy is:
use strict;
use warnings;
use LWP:
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
my $url =
http://news.google.co.uk/search?q=~...0&hl=en&safe=off&start=0&as_qdr=all&filter=0;
$mech->proxy('http','http://127.0.0.1:8088');
$mech->get($url);
my @links_to_check = grep { $_->url() !~ /google/i}
$mech->find_all_links( url_regex => qr/\./i );
foreach my $links_to_check (@links_to_check)
{
print "$links_to_check \n";
}
with LWP:
LWP::UserAgent::new: () LWP::UserAgent:
LWP::UserAgent::request: () HTTP::Cookies::add_cookie_header: Checking
news.google.co.uk for cookies HTTP::Cookies::add_cookie_header: Checking
..google.co.uk for cookies HTTP::Cookies::add_cookie_header: Checking
google.co.uk for cookies HTTP::Cookies::add_cookie_header: Checking .co.uk
for cookies HTTP::Cookies::add_cookie_header: Checking co.uk for cookies
HTTP::Cookies::add_cookie_header: Checking .uk for cookies
LWP::UserAgent::send_request: GET
http://news.google.co.uk/search?q=~...00&hl=en&safe=off&start=0&as_qdr=all&filter=0
LWP::UserAgent::_need_proxy: Proxied to http://127.0.0.1:8088
LWP:
LWP::UserAgent::request: Simple response: Not Found Use of uninitialized
value in concatenation (.) or string at movien1.pl line 28. 0 news items
found