Forms

They have: 568 posts

Joined: Nov 1999

I've got 2 things I need to know about.

1) Is there a Perl module that will allow Perl to fill out forms and submit them to web sites.

2) Is it possible for Perl to store cookies like Netscape or IE, this one goes with #1 if you were wondering.

See I am trying to login to an online service from my computer using perl. But it won't work unless I can fill out the form AND support the cookie that goes along with the service.

They have: 568 posts

Joined: Nov 1999

Anyone?

They have: 850 posts

Joined: Jul 1999

Orpheus,
I am not %100 sure what you mean, but if the form is using GET method to parse the input, you could fill out the form, and have you browser take you to the results.

So, if the form you wanted to login to used the GET method, and If I understand what you are trying to do, you could do it

so if the site you wanted to login to was like: http://url.com/cgi-bin/login.cgi?name=LOGINNAME&password=PASSWORD
you could do somthing like

code:

$login="rob";
password="pword";
print "Location: [url="http://url.com/cgi-bin/login.cgi?name=$login&password=$password\nURI:"]http://url.com/cgi-bin/login.cgi?name=$login&password=$password\nURI:[/url]  http://url.com/cgi-bin/login.cgi?name=$login&password=$password\n\n"  ;
[/code]

Or you could use the LWP::Simple to connect to the URL, and ave the html page in a $var.
code:
use LWP::Simple;
$login="rob";
password="pword";
$html = get("http://url.com/cgi-bin/login.cgi?name=$login&password=$password
");
[/code]

Sorry if that did not help at all.

**Patrick, apply the [ code ] hack again please   **

------------------
Dogs and cats consume over $11 billion worth of pet food a year.

[This message has been edited by robp (edited 26 January 2000).] 

They have: 568 posts

Joined: Nov 1999

Well the problem now is getting perl to store the cookie like the browser does.

any ides?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.