in reply to Re: can't get WWW::Mechanize to sign in on JustAnswer
in thread can't get WWW::Mechanize to sign in on JustAnswer

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.
  • Comment on Re^2: can't get WWW::Mechanize to sign in on JustAnswer

Replies are listed 'Best First'.
Re^3: can't get WWW::Mechanize to sign in on JustAnswer
by Anonymous Monk on May 26, 2011 at 21:24 UTC
    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?

      If you're the first Anonymous Monk then I have also clicked your link and didn't find that it addressed what the OP was looking for. It's a helpful link and all but it won't fix the problem.

      I went to the site and looked at the source code. The problem here is JustAnswer has missed some logic in their JavaScript code. When you turn off JavaScript it shows the SIGN UP form and never lets you see the sign IN form.

      Best thing to do is let them know they have a bug in their code and wait for them to fix it. Then your code should work fine.

        Javascript is not magical.

        After whatever Javascript has run, the browser still sends some bytes over the network to the webserver. All you have to do is find out what bytes need to be sent, and then send just these bytes via a Perl script. There is no magic, just plain hard work with Mozilla Live HTTP Headers and/or Wireshark.

        Also see: On The Internet, Nobody Knows you're a Dog - the server only receives bytes and cannot distinguish between Perl and a Browser as long as both send the same data.

        The Firefox browser supports javascript.

        LiveHttpHeaders addon shows you the HTTP Request that gets sent so you don't have to reverse-engineer the javascript.

        Then simply get Mechanize to send the same HTTP Request, either through Mechanize calls, or by crafting a custom HTTP::Request.

        Or simply use WWW::Mechanize::Firefox.

        No, these instructions are not a solution to the OPs exact problem (not a fish), instead, they're the solution to every such problem (instructions on how to fish).

        Like Corion says, javascript is not magical