Hi again,
the web page in question is
Here
What I'm trying to do is get an approximation of the popularity of a surname in a particular area, and I dont plan to use any more than the 10 searches i'm allocated per day - I might even get away with one search per surname. I have the BT CD(95 pounds) but I cant use it for this purpose, and I've contacted BT and the webmaster and I've got no reply...
Heres the code I'm using...
#!/usr/bin/perl #-Tw
use lib '/home/baz/public_html';
use strict;
$| = 1;
use CGI::Carp "fatalsToBrowser";
use CGI ":all";
use DBI;
use LWP::Simple;
use LWP::UserAgent;
use HTML::TokeParser;
use MyVars qw($footer);
use HTTP::Cookies;
my $ua = LWP::UserAgent->new;
$ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
my $query = new CGI;
$ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt",autosave =
+>1));
print $query->header("Ver 1.1"),
print start_html;
my $req =
HTTP::Request->new(GET=>"http://www.bt.co.uk/directory-enquiries/dq_ho
+me.jsp");
my $res = $ua->request($req);
open (LOG, ">>res.html");
print LOG "$res->content";
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.