473,221 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

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 7862
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Richard Bell | last post by:
I'm returning to Perl and Linux after many years away and while I know/knew way back when about Perl and Unix I'm new to this world today. I'm considering using LWP as the heart of a Web...
0
by: Thomas Götz | last post by:
Hi, I want to retrieve a webpage that includes unicode characters using the LWP::Simple module. But how can I tell LWP::Simple which coding it should use as I haven't found anything concerning...
1
by: Richard Johnson | last post by:
I am a C++ newbie and am trying to send simple text data to my local printer. My printer is a USB printer and I have tried the following code using my USB port. This code executes but does not send...
5
by: Le, Thanh-Nhan | last post by:
Hi, I want to send a simple mail with C#. I have tried the following, but they don't work: - some solutions on CodeProject websites. - shellExecute(mailto:xxx@yyy.com?subject=aaa&body=bbb). ...
0
by: jnair | last post by:
from the perl man pages of LWP::Simple mirror($url, $file) Get and store a document identified by a URL, using If-modified- since, and checking the Content-Length. Returns the HTTP response...
3
by: prophet | last post by:
I know that this is going to be so simple to fix, but I have been pulling my hair out trying to see the forest through the trees...... What I want to do is change the onMouseOver so that when you...
4
by: Tony M | last post by:
VS 2005 - XP media - VB .net - winforms - .net 2.0 Just trying to send an email, here is the code and the error message that I get. I can't figure out how to fix it?
1
by: Freedolen | last post by:
Hi All, With the below code i am able to get the contents, but i need to get the filename whether it is 'index.html' or 'index.htm' or 'google.html'. How can i get it? use strict; use...
1
by: dibyenduchatterjee | last post by:
Am using LWP module. I wish to read a page and print a part of it. I want t read first 300 characters of <div id="bodyContent"> written inside the html page. Code I am using : #!/usr/bin/perl...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.