I'm trying to log in to blogger, but I keep on getting the login screen. I think this might have something to do with cookies.
I noticed there is a redirect page with javascript on it that redirects to the main page. I can't seem to get around this.
Here is my script. Any help or insight would be greatly appreciated.
#!/usr/bin/perl
use WWW::Mechanize;
use HTTP::Cookies;
my $email = " ";
my $password = " ";
my $url = "https://www.google.com/accounts/ServiceLoginBox?service=blo
+gger&continue=http%3A%2F%2Fwww.blogger.com%2Floginz%3Fd%3Dhttp%25
+3A%252F%252Fwww.blogger.com&alwf=true&uilel=3&skipvpage=t
+rue&rm=false&naui=8&showra=1&fpui=2&hl=en&nui
+=1&naui=8&roec=Unknown&alwf=true&service=blogger&
+continue=http%3A%2F%2Fwww.blogger.com%2Floginz%3Fd%3D%252Fstart&f
+pui=2&rm=false&alinsu=1&uilel=3&hl=en&skipvpage=t
+rue";
my $mech = WWW::Mechanize->new;
my $cookie_jar = HTTP::Cookies->new(
'file' => 'c:/lwp_cookies.dat',
);
$mech->agent('Mozilla/5.0(Windows; U; Windows NT 5.1; en-US) Gecko/200
+61206 Firefox/1.5.0.9');
$mech->cookie_jar($cookie_jar);
$mech->get($url);
$mech->set_fields(
"Email" => "$email",
"Passwd" => "$password",
);
$mech->submit;
print $mech->content;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.