Você tem que usar wget --post-data
para construir uma string com todos os valores que serão enviados no formulário, também --content-disposition
e --trust-server-names
para permitir o uso de nomes fornecidos pelo servidor. Você também precisa usar o próprio URL da página, já que a ação do formulário é ""
.
Do primeiro formulário na página:
<form method="post" action="" id="download-1">
<input type="hidden" value="12a6c92ab9" name="amd_developer_central_nonce" id="amd_developer_central_nonce">
<input type="hidden" value="/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/" name="_wp_http_referer">
<input type="hidden" value="QU1ELUFQUC1TREstdjIuOS1sbngzMi50Z3o=" name="f">
</form>
Você construirá o seguinte comando: wget --content-disposition --trust-server-names --post-data='amd_developer_central_nonce=12a6c92ab9&_wp_http_referer=/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/&f=QU1ELUFQUC1TREstdjIuOS1sbngzMi50Z3o=' http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/
, em ação:
aularon ~ $ wget --content-disposition --trust-server-names --post-data='amd_developer_central_nonce=12a6c92ab9&_wp_http_referer=/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/&f=QU1ELUFQUC1TREstdjIuOS1sbngzMi50Z3o=' http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/
--2014-02-04 23:39:49-- http://developer.amd.com/tools-and-sdks/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/downloads/
Resolving developer.amd.com (developer.amd.com)... 50.116.16.216
Connecting to developer.amd.com (developer.amd.com)|50.116.16.216|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 100284370 (96M) [application/octet-stream]
Saving to: ‘AMD-APP-SDK-v2.9-lnx32.tgz’
4% [==> ] 4,452,576 544KB/s eta 3m 4s ^C