Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

using WWW::Mechanize with HTTPS

by Anonymous Monk
on Apr 30, 2005 at 02:57 UTC ( #452789=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I read that in order to use WWW::Mechanize with a secure HTTPS you need to have SSLeay. I went to the docs for SSLeay and it really doesn't show you how to merge the two scripts together. The entire script is
#!/usr/bin/perl use strict; use warnings; use SSleay; use CGI::Carp qw(fatalsToBrowser); use CGI qw/:standard/; use WWW::Mechanize; my $name= "##"; my $pass= "##"; my $browser=WWW::Mechanize->new(); $browser->get(""); $browser->form(1); $browser->field("username", $name); $browser->field("password", $pass); $browser->click(); print "Location: +sp\n\n";
Can someone help me figure out how to use SSLeay to get this to work?

Replies are listed 'Best First'.
Re: using WWW::Mechanize with HTTPS
by moot (Chaplain) on Apr 30, 2005 at 03:22 UTC
    All you need is to have Crypt::SSLeay installed:
    $ perl -MWWW::Mechanize -e '$w = WWW::Mechanize->new; $w->get("https:/ +/"); print $w->uri; print $w->content'|head <html> <head> <META content="index,follow" name="robots"> <META content="Yahoo! Mail Free reliable easy SpamGuard antivirus stor +age" name="keywords"> <META content="Take a closer look at Yahoo! Mail. Get these great fea +tures: Powerful protection against spam and viruses, 250MB of email s +torage, Message size up to 10MB, and Mail anywhere there's a web conn +ection" name="description"> <link type="text/css" rel="stylesheet" href=" +g/mail_style.css"> <title>Yahoo! Mail - The best web-based email!</title> <style type="text/css">
    WWW::Mechanize lives on top of LWP::UserAgent, which only requires that Crypt::SSLeay be installed for it to work automagically.
Re: using WWW::Mechanize with HTTPS
by cbrandtbuffalo (Deacon) on Apr 30, 2005 at 12:41 UTC
    If you tried it and it didn't work, post the error message you received and we can try to troubleshoot.
Re: using WWW::Mechanize with HTTPS
by blucap (Initiate) on Feb 14, 2008 at 17:04 UTC
    Note that it is fairly simple to add the U of Winnipeg Active Perl 5.8 repository (where SSLeay can be found) to the list of repositories that Active Perl searches. See:

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://452789]
Approved by moot
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2023-12-02 22:20 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (19 votes). Check out past polls.