Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LWP, HTTP Form and Javascript

Status
Not open for further replies.

cacheung

Programmer
Aug 9, 2005
6
CA
Hi,

I used to be able to use LWP and HTTP::Form to grab a web form, fill it out and click on the submit button.
Code:
my $ua = LWP::UserAgent->new();
...
# set $form
...
$ua->request($form->click('HitIt'));

Now, the form has been changed:
Code:
<input type="button" value="Submit" onClick="submitCheck()" name="HitIt">
<!-- elsewhere in the web page -->
function submitCheck() {
...
}

When I run the perl code, I get
"No clickable input with name HitIt ..."

What do I need to do to be able to submit the data?
 
Why do you even need to click the submit button in the first place?

Code:
my $ua = new LWP::UserAgent;
my $reply = $ua->post ('[URL unfurl="true"]http://domain/action.cgi',[/URL] {
   field => 'value',
   field2 => 'another value',
   etc => 'for each input field',
});

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Thanks Kirsle.
I tried your suggestion, but now I got
No clickable input with name SUBMIT
 
That's kind of a weird error. I've never seen it before anytime I'd use LWP::UserAgent. Can you post your complete code?

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top