470,636 Members | 1,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

send username and password with lwp:simple

I'm using the following code to retrieve a web page. It seems that
I'm able to pass the username and password to the web page, but it
does nothing. Looking at the source code of the web page it asks for
an "OnClick", which I figure refers to the "enter" button, (there's
also a reset button after the "enter" button.) I do I go about send
the information and finalizing it with the "OnClick" or "enter" button
in the page. Here's the script I am using. Thanks in advance.

my $url = 'http://192.168.0.1?Username=myuser&Password=mypass';
# Connection to host "pfinal"

use LWP::Simple;
my $content = get $url;
die "Couldn't get $url" unless defined $content;
$content = get($url);
print $content;
Jul 19 '05 #1
2 7748
john brown wrote:
I'm using the following code to retrieve a web page. It seems that
I'm able to pass the username and password to the web page, but it
does nothing. Looking at the source code of the web page it asks for
an "OnClick", which I figure refers to the "enter" button, (there's
also a reset button after the "enter" button.) I do I go about send
the information and finalizing it with the "OnClick" or "enter" button
in the page. Here's the script I am using. Thanks in advance.

my $url = 'http://192.168.0.1?Username=myuser&Password=mypass';
# Connection to host "pfinal"

use LWP::Simple;
my $content = get $url;
die "Couldn't get $url" unless defined $content;
$content = get($url);
print $content;


use HTML::Form;

$request = $form->click('submit');
my $res = $ua->request($request);

this should get you further.
http://search.cpan.org/~gaas/libwww-...b/HTML/Form.pm
Jul 19 '05 #2
Erik de Mare <er**@oezie.org> wrote in message news:<40**********************@dreader-2.news.scarlet-internet.nl>...
john brown wrote:
I'm using the following code to retrieve a web page. It seems that
I'm able to pass the username and password to the web page, but it
does nothing. Looking at the source code of the web page it asks for
an "OnClick", which I figure refers to the "enter" button, (there's
also a reset button after the "enter" button.) I do I go about send
the information and finalizing it with the "OnClick" or "enter" button
in the page. Here's the script I am using. Thanks in advance.

my $url = 'http://192.168.0.1?Username=myuser&Password=mypass';
# Connection to host "pfinal"

use LWP::Simple;
my $content = get $url;
die "Couldn't get $url" unless defined $content;
$content = get($url);
print $content;


use HTML::Form;

$request = $form->click('submit');
my $res = $ua->request($request);

this should get you further.
http://search.cpan.org/~gaas/libwww-...b/HTML/Form.pm


Thanks for the quick response. I've tried it, but I get an error when
I try include HTML::FORM. Still working on it.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Richard Bell | last post: by
reply views Thread by Thomas Götz | last post: by
1 post views Thread by Richard Johnson | last post: by
5 posts views Thread by Le, Thanh-Nhan | last post: by
3 posts views Thread by prophet | last post: by
4 posts views Thread by Tony M | last post: by
1 post views Thread by Freedolen | last post: by
1 post views Thread by Korara | last post: by
???
reply views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.