Suppose there is a website that has a hierarchical series of option/select drop-downs. When the user makes a selection from drop-down A, the value of their selections is posted to the server and drop-down B is populated. Drop-down B populates drop-down C in the same fashion. When drop-down C is selected, data is shown particular to their selection in C. Previous selections are preserved along the way, unless they change something higher up in which case everything is reset below that. In HTML it looks like this:
Drop-Down A
<select class="submitOnChange">
<option value="a1">A</option>
<option value="a2" SELECTED>B</option>
<option value="a3">C</option>
</select>
Drop-Down B
<select class="submitOnChange">
<option value="b1" SELECTED>B-A</option>
<option value="b2">B-B</option>
<option value="b3">B-C</option>
</select>
Drop-Down C
<select class="submitOnChange">
<option value="c1">B-A-A</option>
<option value="c2">B-A-B</option>
<option value="c3" SELECTED>B-A-C</option>
</select>
[Data for B-A-C is shown here because they clicked that]
The script works specifically by sending a POST of all the selected options to itself every time a select changes.
I would like to download all of the data from this web application; that is to say I would like to see the data associated with all possible drop-down C values. What would be the best way to do that? I see that wget is setup to work recursively with links, but seemingly not with forms like this. I’d be interested in the simplest and fastest way for doing this. I know PHP so I’d be open to writing up a script in cURL, however if there’s a simpler solution such as a program out there that does this simply already (wget?) I’d be interested. Any tips or suggestions welcome.
You may use CURL to do that.
You can use it from command line :
Source is the CURL manual : http://curl.haxx.se/docs/manual.html