davidov0009 has asked for the wisdom of the Perl Monks concerning the following question:
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.
use strict; use CGI;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: WWW::Mechanize and Facebook login
by learnperl (Acolyte) on Dec 11, 2007 at 05:33 UTC | |
by davidov0009 (Scribe) on Dec 13, 2007 at 03:53 UTC | |
by budman (Sexton) on Apr 27, 2009 at 06:39 UTC | |
by Anonymous Monk on Jul 22, 2009 at 22:13 UTC | |
Re: WWW::Mechanize and Facebook login
by Kanji (Parson) on Dec 11, 2007 at 08:47 UTC |
Back to
Seekers of Perl Wisdom