1
$\begingroup$

I am trying to automate the process of downloading data from my univ. webpage. I need to submit the form in the URL below.

http://202.88.252.21/CuPbhavan/res_newregentry.php?id=4789

An inspection of the page's source reveals that the input-names for the two form-fields to be filled out and submitted by the user are 'varno' and 'sum'. The form uses 'POST' method for submission

What complicates matters is the fact that the 'sum' is dynamic. ie. each time the browser is refreshed, a new set of numbers for the 'fst' and 'snd' fields/ids are generated through a random number function. A checksum() is executed and only then the server honours the request and lets you download the data.

I would like to automate this process. The page's source-code detailing the javascript/AJAX functions used along with the field-names, ids etc. is shown below.

I'd really appreciate any help on this.

enter image description here

$\endgroup$
  • $\begingroup$ I have the feeling you have posted this to the wrong forum. This forum is about the Wolfram Mathematica language, not Ajax and Javascript. $\endgroup$ – Nasser Dec 22 '15 at 0:28
  • $\begingroup$ Oops....Sorry for the confusion. .....I am not a programmer and the only language that I know is Wolfram Mathematica.....I know that the UrlFetch, URLExecute and Import functions support these kind of things, but i am not exactly sure how to accomplish my goal using these functions. $\endgroup$ – krishnakumar G Dec 22 '15 at 0:30
  • $\begingroup$ It was not clear to me that you meant to use Mathematica for what you are doing, since I saw no Mathematica code posted and saw only HTML and Javascript. But that is fine. May be someone would know how to do this in Mathematica. $\endgroup$ – Nasser Dec 22 '15 at 0:34
  • $\begingroup$ Are the random ids stored as cookies? $\endgroup$ – Mike Honeychurch Dec 22 '15 at 1:23
  • $\begingroup$ Hi Mike, I am not very sure about this. Basically each time you refresh that URL in your browser, you get different numbers populated in the input fields. As a user, I am supposed to do the math manually and type the result in the 'sum ' field. After I hit submit, the server gives me the data that I want. I am looking for a way to automate this process by somehow parsing the fields upon each refresh, computing the sum and submitting it. Need to repeat For about 50 times $\endgroup$ – krishnakumar G Dec 22 '15 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.