473,513 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7880
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
3089
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
2080
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
4378
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
4165
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
1190
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
1409
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
4244
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
1484
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
1679
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...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7161
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.