I would like to communicate with interactive web forms, e.g., get the same HTML response as if I had clicked a "select" button and then clicked a "submit" button on a web page. This is for automated download of scientific data from an archive. The "select" button is HTML coded as follows:

<input id="ibmarkpublic" class="markpublic" type="button" value="MarkPublic">

The "submit" button is coded as follows:

<input type="submit" class="submit" value="Request selected datasets" onclick="retrieve.action='http://dataportal.examplesite.org/rh/confirmation'; return true;">

The actions refer to javascript

<script type="text/javascript" src="/wdb/jslib/wdb_result_functions.js"></script>
<script type="text/javascript"> ....

and there's the following statement at the head of the table of data items:

<form name="retrieve" method="POST" action="http://dataportal.examplesite.org/rh/confirmation">

I've tried using code of the kind

Import[url, "Data", "RequestMethod" -> "POST", "RequestParameters" -> {"MarkPublic"-> "True", "submit" -> "True"}]

but couldn't succeed receiving the same HTML answer as when clicking the two buttons by hand in the browser. Is the "RequestMethod" option documented anywhere?

  • 2
    $\begingroup$ Closely related: 91899 $\endgroup$
    – C. E.
    Aug 28 '15 at 14:31
  • $\begingroup$ Also related: (2362). $\endgroup$
    – WReach
    Aug 29 '15 at 0:53

Browse other questions tagged or ask your own question.