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!
In reply to Mech and SSL by SpacemanSpiff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |