Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello again monks. Same problem but I have more helpful information, I think. In short I'm writing a small login script to sign me into http://www.justanswer.com/login.aspx. It has a email/password combo, pretty simple. However there appears to be JS in the page that loads a different form all together. Because the JS doesn't work in Mech I can't get to the normal sign in form. If you go to the link I gave you and you choose NEW USER you'll see it loads a new form instead. Can someone help me figure out a way to get this to work on their site? I really could use some help here. I just can't figure out how to get this script to work for me.
use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use WWW::Mechanize; my $email = ''; my $password = ''; my $ja_login = 'http://www.justanswer.com/login.aspx'; my $answer_page = 'http://www.justanswer.com/expert/question-list.aspx +'; my $confirm_signon = 'My Questions'; my $form_radio_button = 'returning'; print header, start_html("JA"); my $mech = WWW::Mechanize->new(agent => 'Windows IE 8'); $mech->get($ja_login);

Replies are listed 'Best First'.
Re: can't get WWW::Mechanize to sign in on JustAnswer
by Anonymous Monk on May 26, 2011 at 14:22 UTC
    Can someone help me figure out a way to get this to work on their site? I really could use some help here. I just can't figure out how to get this script to work for me.

    Instructions on how to figure it out are at Re^7: Perl Mechanize - Header Help required.

      That link you referenced really doesn't directly or even indirectly address the problem I am having. I'm not new to Mechanize, I've created dozens of bots with it over the years but this is the first time I've been in a situation where JS is messing up my login.
        That link you referenced really doesn't directly or even indirectly address the problem I am having. I'm not new to Mechanize, I've created dozens of bots with it over the years but this is the first time I've been in a situation where JS is messing up my login.

        Did you know that WWW::Mechanize does not support javascript? Take look at the links in the link I referenced, that is the way to solve every Mechanize problem, esp JS problems.

      I have to disagree with the Anony monk who posted the link. It really doesn't help in your situation. I wish I could help you but I've dealt with javascript and this module before and it is never pretty. Hopefully another monk will be able to assist you.
        I have to disagree with the Anony monk who posted the link. It really doesn't help in your situation. I wish I could help you but I've dealt with javascript and this module before and it is never pretty. Hopefully another monk will be able to assist you.

        How do you figure?