Dear Monks,
I am attempting to login to facebook using WWW::Mechanize but when I test to see the resulting page using $mech->uri() it outputs the page that would result form incorrect login information. Here is the code I am using:
#!/usr/bin/perl
use strict;
use WWW::Mechanize;
my $url = "http://www.facebook.com";
my $mech = WWW::Mechanize->new();
$mech->get($url);
$mech->submit_form(
form_name => "loginform",
fields => {
email => $ARGV[0],
pass => $ARGV[1]
}
);
print $mech->uri() . "\n";
I am unclear as to why it is unable to login, assuming the info provided is valid. Also, mech-dump spits back that the return type of the other login page for facebook (not used in this script) is of content type text/plain NOT of text/html. Is that a cause for concern when using Mech?
Any help appreciated.