Link to home
Start Free TrialLog in
Avatar of ibyxtl
ibyxtl

asked on

Automating Form Submission

I used the following code as suggested in S20.2 of Perl Cookbook:

#!/usr/usc/bin/perl -w

use LWP::Simple;
use URI::URL;

my $url = url('http://164.195.100.11/netacgi/nph-Parser');
$url->query_form(TERM1 => 'alcatel',
             FIELD1 => 'ASNM',
             d => 'pt95');
unless (defined ($content = get $url)) {
    die "could not get $url\n";
}

print "$content\n";


I get back an error page:

Error #1003
<HTML>
<HEAD><TITLE>Error</TITLE></HEAD>
<BODY><H1>Error!</H1>
<HR>
<H4>BRS was unable to process your request.  A diagnostic message was mailed to the appropriate personel.</H4>
</BODY></HTML>


Where am I going wrong? By the way, this is supposed to retrieve a page from the US Patent & Trademark Office.


thanks,

ibyxtl
ASKER CERTIFIED SOLUTION
Avatar of clockwatcher
clockwatcher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paul Maker
try this. ive just tried it and it works

use LWP::Simple;

$content = get("http://bt754554/");
if($content)
{
     print $content;
}
else
{
   print "Problem";
}