Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:49:59+00:00 2026-06-03T14:49:59+00:00

I am using plugin WWW::Scripter (subclass of WWW::Mechanize ) to authenticate to my host’s

  • 0

I am using plugin WWW::Scripter (subclass of WWW::Mechanize) to authenticate to my host’s login page. They use Ruby with some JavaScript functions on the login page, so I can’t just use the LWP::Agent module. Here is the code:

#!/usr/bin/env perl
use strict;
use warnings;
use diagnostics;

use LWP::Debug qw(+);
use LWP::ConnCache;
use WWW::Scripter;

my $url = 'https://control.vp.net/login';
my $username = 'example@example.com';
my $password = 'example';

my $w = WWW::Scripter->new(keep_alive => 1) or die "error1: $!\n";
$w->conn_cache(LWP::ConnCache->new);
$w->use_plugin('JavaScript') or die "error2: $!\n";
$w->credentials($url, undef, $username, $password) or die "error3: $!\n";
$w->get($url) or die "error4: $!\n";
print $w->content() or die "error5: $!\n";

I am having the following error:

Uncaught exception from user code:
error3

I have spent number of hours googling and I feel that I really need some of your help now. I will appreciate any help which help to understand why I can’t authenticate. My Perl version is 5.10.1 on Ubuntu 11 if it matters.

Thanks.

Update

I have changed one line in the code to:

$w->credentials($username, $password) or die "error3: $!\n";

and getting just white page now. If I enable the diagnostics pragma, a rather general error appears:

Use of uninitialized value in subroutine entry at blib/lib/Net/SSLeay.pm
(autosplit into blib/lib/auto/Net/SSLeay/randomize.al) line 2227 (#1)
(W uninitialized) An undefined value was used as if it were already
defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:50:00+00:00Added an answer on June 3, 2026 at 2:50 pm

    credentials is good for standard HTTP authentication, but Web forms are something different. Remove that method call and learn how Web forms function. The JavaScript has no influence on the Web form, Mechanize is enough.

    use strictures;
    my ($url, $username, $password)
        = qw(https://control.vps.net/login example@example.com example);
    my $w = WWW::Mechanize->new;
    $w->get($url);  # automatically raises exception on HTTP errors
    $w->submit_form(with_fields => {
        'session[email_address]' => $username,
        'session[password]' => $password,
    });
    die 'login failed'
        if $w->content =~ /your email and password combination were incorrect/;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using perl modules WWW::Scripter (based on WWW::Mechanize ) with JavaScript plugin and
I am using the infinite scroll plugin http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/ to load page content. I have
I Use jQuery Sticky Notes Plugin http://www.jquery-sticky-notes.com/ I Connect it with database using asp.net
I am using this plugin: http://plugins.jquery.com/project/history on this page: http://www.crtaci.info/index.php?autocom=majice I dont know why
I am using WWW::Scripter to grab a page written with javascript/ajax, the link to
I'm trying to use the plugin (http://www.vertstudios.com/blog/jquery-sticky-scroller-position-fixed-plugin ) on a page i'm building. I'm
I'm using this plugin: http://www.jeremymartin.name/projects.php?project=kwicks And my code follows this example: http://www.jeremymartin.name/examples/kwicks.php?example=7 I'm using
I'm using this great plugin: http://www.sanisoft.com/blog/2009/06/22/jquery-auto-correct-plugin/ But it's not working with 1.6.2 or greater...
Im using the plugin detailed here: http://www.thatagency.com/design-studio-blog/2009/01/refreshing-an-element-at-a-set-time-interval-using-jquery-and-a-sprinkle-of-ajax/ Here is my jQuery: $(document).ready(function(){ var j
I am using the JQuery plugin twosidedmultiselect http://www.stevefenton.co.uk/cmsfiles/assets/File/twosidedmultiselect.html and then once options are placed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.