WWW::Mechanize::Firefox because I don't want to deal with the GUI.

Use WWW::Mechanize::PhantomJS then, comes without GUI, supports javascript, simple to install prereqisites at http://phantomjs.org/download.html

... here is the POST data:

That doesn't look very much like POST data, not any regular kind of POST data, where did you get that from?

to see if I can just manually do what the javascript is doing within my perl code

Maybe you realize this -- but its not going well -- take the easy way out :)

How would I replicate what the javascript is doing within perl? Do I just fill out all the fields in the POST data above, and then GET the Location: URL?

Well, you'd do it by figuring out and knowing what the javascript does and the way it does it, then replicate that request -- do you know javascript?

You could also intuit from the request what to do, but this is a lot of guessing, and guessing is a poor painful strategy

You could also read the docs for the website and use their official api ... guesswork eliminated :)

What you've posted so far is nowhere near enough information to do any of these things :) but I wouldn't even try, I'd be lazy, I'd use phantomjs

If I use one of the javascript modules, is it literally as simple as calling eval on the function bound to the button once I have set the appropriate variables (I assume the JS function will handle the ANTI_CSRF_TOKEN?)

You wish :) in theory maybe... browsers are hard to write ... you could try it to see what happens :)

Your best chances of success are phantomjs, IMHO naturally

Best of luck


In reply to Re: WWW::Mechanize and buttons tied to javascript by Anonymous Monk
in thread WWW::Mechanize and buttons tied to javascript by Special_K

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.