send username and password with lwp:simple

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john brown

    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?Use rname=myuser&Pa ssword=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;
  • Erik de Mare

    #2
    Re: send username and password with lwp:simple

    john brown wrote:[color=blue]
    > 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?Use rname=myuser&Pa ssword=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;[/color]

    use HTML::Form;

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

    this should get you further.

    Comment

    • john brown

      #3
      Re: send username and password with lwp:simple

      Erik de Mare <erik@oezie.org > wrote in message news:<404ca50b$ 0$8869$7a628dc9 @dreader-2.news.scarlet-internet.nl>...[color=blue]
      > john brown wrote:[color=green]
      > > 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?Use rname=myuser&Pa ssword=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;[/color]
      >
      > use HTML::Form;
      >
      > $request = $form->click('submit' );
      > my $res = $ua->request($reque st);
      >
      > this should get you further.
      > http://search.cpan.org/~gaas/libwww-...b/HTML/Form.pm[/color]

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

      Comment

      Working...