P
P.R.Brady
I tried my web crawler/link checker on a neighbour's site and found
problems with the button top right entitled 'cymraeg' in this page (and
the same button on others):
http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm
I think I need to extract the url:
http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg
for the get as in the following code but I am getting 404 not found
returned.
Internet Explorer seems very happy with the button and returns the Welsh
version, but Netscape 7 is not entirely happy with it either.
Where is the problem? My hand extraction of the target url, the code
below or an issue in the host?
Regards
Phil
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Response;
use HTML::TokeParser;
my $referer=
'http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm';
my $url=
'http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg';
#open the browser
my $browser = LWP::UserAgent->new;
$browser->timeout(30);
my $response = $browser->get($url,
Referer => $referer,
'User-Agent' => 'Mozilla/7. [en] (Win98; U)',
'Accept' => 'text/html, image/gif, image/x-xbitmap,
image/jpeg, image/pjpeg, image/png, */*',
'Accept-Charset' => 'ISO-8859-1, *, utf-8',
'Accept-Language' => 'cy, en, en-GB',
'media-range' => '*/*',
'max-redirect' => '70',
);
my $status= $response->status_line;
print "Status=$status\n";
my $base = $response->base;
print "Base=$base\n";
if ($response->is_success) {
print "Show data?";
$_= <STDIN>;
if (/y/i){
my $doc = $response -> content;
print "$doc\n";
}
}
exit;
problems with the button top right entitled 'cymraeg' in this page (and
the same button on others):
http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm
I think I need to extract the url:
http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg
for the get as in the following code but I am getting 404 not found
returned.
Internet Explorer seems very happy with the button and returns the Welsh
version, but Netscape 7 is not entirely happy with it either.
Where is the problem? My hand extraction of the target url, the code
below or an issue in the host?
Regards
Phil
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Response;
use HTML::TokeParser;
my $referer=
'http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm';
my $url=
'http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg';
#open the browser
my $browser = LWP::UserAgent->new;
$browser->timeout(30);
my $response = $browser->get($url,
Referer => $referer,
'User-Agent' => 'Mozilla/7. [en] (Win98; U)',
'Accept' => 'text/html, image/gif, image/x-xbitmap,
image/jpeg, image/pjpeg, image/png, */*',
'Accept-Charset' => 'ISO-8859-1, *, utf-8',
'Accept-Language' => 'cy, en, en-GB',
'media-range' => '*/*',
'max-redirect' => '70',
);
my $status= $response->status_line;
print "Status=$status\n";
my $base = $response->base;
print "Base=$base\n";
if ($response->is_success) {
print "Show data?";
$_= <STDIN>;
if (/y/i){
my $doc = $response -> content;
print "$doc\n";
}
}
exit;