P
phil court
Hi all,
I am trying to write a script to retrieve a web page. the script is detailed
below. My problem is as follows.
The script can successfully obtain web pages such as http://news.bbc.co.uk
and http://www.dreamteamfc.com
However it fails on the following URL
http://www.dreamteamfc.com/dtfc04/servlet/PostPlayerList?catidx=1&title=GOAL
KEEPERS&gameid=167
The returned web page (saved in myOUT.txt) contains
<HTML><HEAD><SCRIPT
LANGUAGE="JAVASCRIPT">location.replace("http://www.dreamteamfc.com");</SCRIP
T></HEAD></HTML>
The above URL is valid as I have pasted into my browser and it displays OK.
The above URL is part of the
http://www.dreamteamfc.com page and is obtained via a javascript:dt_pop
(Whatever that is).
Anyway here is the script, any ideas ?? Thanks
#!/usr/bin/perl -w
use URI;
use LWP::Simple;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
$ua->proxy('http', 'http://128.87.251.250:8080');
#my $content = get("http://news.bbc.co.uk");
my $content =
get("http://www.dreamteamfc.com/dtfc04/servlet/PostPlayerList?catidx=1&title
=GOALKEEPERS&gameid=167");
#my $content = get("http://www.dreamteamfc.com");
$script = "myOUT.txt";
unlink $script;
open (OUT,">>$script") || die "cannot open $script for open";
if (defined $content)
{
#$content will contain the html associated with the url mentioned above.
print OUT $content ;
}
else
{
#If an error occurs then $content will not be defined.
print "Error: Get stuffed";
}
close OUT;
I am trying to write a script to retrieve a web page. the script is detailed
below. My problem is as follows.
The script can successfully obtain web pages such as http://news.bbc.co.uk
and http://www.dreamteamfc.com
However it fails on the following URL
http://www.dreamteamfc.com/dtfc04/servlet/PostPlayerList?catidx=1&title=GOAL
KEEPERS&gameid=167
The returned web page (saved in myOUT.txt) contains
<HTML><HEAD><SCRIPT
LANGUAGE="JAVASCRIPT">location.replace("http://www.dreamteamfc.com");</SCRIP
T></HEAD></HTML>
The above URL is valid as I have pasted into my browser and it displays OK.
The above URL is part of the
http://www.dreamteamfc.com page and is obtained via a javascript:dt_pop
(Whatever that is).
Anyway here is the script, any ideas ?? Thanks
#!/usr/bin/perl -w
use URI;
use LWP::Simple;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
$ua->proxy('http', 'http://128.87.251.250:8080');
#my $content = get("http://news.bbc.co.uk");
my $content =
get("http://www.dreamteamfc.com/dtfc04/servlet/PostPlayerList?catidx=1&title
=GOALKEEPERS&gameid=167");
#my $content = get("http://www.dreamteamfc.com");
$script = "myOUT.txt";
unlink $script;
open (OUT,">>$script") || die "cannot open $script for open";
if (defined $content)
{
#$content will contain the html associated with the url mentioned above.
print OUT $content ;
}
else
{
#If an error occurs then $content will not be defined.
print "Error: Get stuffed";
}
close OUT;