SpacemanSpiff has asked for the wisdom of the Perl Monks concerning the following question:
Basically, the idea here was to attempt a login, then determine a success or failure by finding the sign out link. At the end I threw in a small parse command so I could see what the script is seeing. That's when I found out Yahoo is throwing even the unsecured logins through an SSL link. Here's the output:#!/usr/bin/perl -w use strict; use WWW::Mechanize; use HTML::TokeParser; my $login = "xxxxxxxxxx"; my $password = "xxxxxxx"; my $url = "http://login.yahoo.com/config/login?"; my $mech = WWW::Mechanize->new(); $mech->get($url); $mech->form(); $mech->field("login","$login"); $mech->field("passwd","$password"); $mech->submit(); if ($mech->find_link( text => "Sign Out")){ print "Success!\n" } else{ print "Fail\n"; } my $test = HTML::TokeParser->new(\$mech->{content}); my $text = $test->get_text; print "$text";
Fail
LWP will support https URLs if the Crypt::SSLeay module is installed. More information at
Now I've read a few (apparently uninformed) sites on the web, and they've mentioned that Mech handles SSL natively. Further research seems to disprove this. Is my only option going through the whole crazy process of installing OpenSSL and then Crypt::SSLeay? It seems like a long way around just to get logged in. Help?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mech and SSL
by holli (Abbot) on Oct 01, 2005 at 09:02 UTC | |
by SpacemanSpiff (Sexton) on Oct 01, 2005 at 09:31 UTC | |
|
Re: Mech and SSL
by Anonymous Monk on Oct 01, 2005 at 09:15 UTC | |
by SpacemanSpiff (Sexton) on Oct 01, 2005 at 17:42 UTC | |
by holli (Abbot) on Oct 01, 2005 at 17:55 UTC | |
by johnnywang (Priest) on Oct 01, 2005 at 21:39 UTC |