Daniele Dinaro <[email protected]> writes: > the form is this: > >> <form method="post" action=" >> http://www.armaholic.net/downloader.php?download_file=chili/addons/units/BTC-Militia-version-1.1.7z >> "> >> <div style="display:inline;margin:0;padding:0"> >> <input type="hidden" name="x" value="3910CD8F"></div> >> <div class="hide-s"> >> <label for="super">What is two plus two?</label> >> <input name="super" type="text" size="4" id="super"></div> >> <input type="hidden" name="captcha" value="I am a human!"> >> <input type="submit" name="submit" value="Click to download =BTC= Militia"> >> </form> > > > I have write this command for my .bat file > >> %WGET% --http-user=Mozilla/5.0 --save-cookies=cookies.txt >> --keep-session-cookies --header="Content-Type: >> application/x-www-form-urlencoded" -c --no-check-certificate >> --post-data=--post-data="captcha=I am a human^!&x=3910CD8F" -c >> http://www.armaholic.net/downloader.php?download_file=chili/addons/units/BTC-Militia-version-1.1.7z
Here are suggestions that I can think of: I many cases, web sites that use "form method=post" will also accept "form method=get", that is, using "?" to add values to the URL. It is much easier to use wget to do that: wget 'http://www.armaholic.net/downloader.php?download_file=chili/addons/units/BTC-Militia-version-1.1.7z?x=3910CD8F&super=4&captcha=I%20am%20a%20human!submit=Click%20to%20download%20%3dBTC%3d%20Militia' Check that you have included all of the field values that you need to include. It appears to me that your wget command does not provide values for 'super' and 'submit' fields. (Yes, the submit button is a field whose value is transmitted, that's how the server knows which submit button in the form was pressed.) Check that you have properly encoded the values of the values. I don't know the details of the rules myself, but I see that the MIME type is x-www-form-urlencoded, which suggests that any character that is special in a URL must be represented with %hh. In this case, spaces and "=" appear in your values. I see that your command includes: >> --post-data=--post-data="captcha=I am a human^!&x=3910CD8F" -c But there shouldn't be two "--post-data" items; the second one is part of the *value* of the post-data option! Is there a simpler form that you can use for practice? For instance, can you write a wget to fetch a Google search? There is a "^" before the "!". If this isn't needed as an escape character in .bat files, it should be removed, as it isn't part of the value you want. Given that the fetch is not HTTPS, you can use wireshark, tcpdump, or other networking monitoring tools to examine the packets when you click the submit button on your browser. That will show exactly how your browser makes the request, and you can copy that. Similarly, you can see how wget sends the request, and adjust your command line appropriately. Or use "wget --debug" to see the request that wget sends. Dale
