in reply to Re: click button
in thread click button

I have the javascript that passed through the console. How do I "convert it" to Perl? Specifically, I believe this is the key part of the code:
"postData": { "mimeType": "application/x-www-form-urlencoded", "text": "loginFrn=0123456789&loginPassword=PasswordX&x=28& +y=6", "params": [ { "name": "loginFrn", "value": "0123456789" }, { "name": "loginPassword", "value": "PasswordX" }, { "name": "x", "value": "28" }, { "name": "y", "value": "6" } ]
I can give you the full code if that isn't correct, but if it is, what does the converted code look like?

Replies are listed 'Best First'.
Re^3: click button
by Corion (Patriarch) on Nov 08, 2015 at 21:21 UTC

    This looks more like data that happens to be readable as a JSON data structure than Javascript code. If you don't know Javascript, then you will need to find somebody who can read the Javascript and tell you what it does or you will need to use one of the other approaches I outlined already, like finding out what the Javascript does and replicating that with Perl or using an implementation of WWW::Mechanize that understands Javascript.

    Just guessing from the content of the data, I would assume that the Javascript simply sends a POST request with the MIME type application/x-www-form-urlencoded and some parameters. If you are wildly guessing, you could try to construct a HTTP::Message that contains that data and see if that already works for you.

    A bit of HTML and HTTP understanding will be necessary though.