in reply to WWW::Mechanize and buttons tied to javascript
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: WWW::Mechanize and buttons tied to javascript
by Special_K (Pilgrim) on Jul 04, 2014 at 17:29 UTC | |
by Anonymous Monk on Jul 05, 2014 at 03:14 UTC |