In my case the problem is with SourceForge.net. Actually I was trying to download these files:


Something did not went good, so I logged wget, and the log file was:

--2012-08-21 09:52:17--  http://sourceforge.net/projects/wxpython/files/wxPython/
Resolving sourceforge.net...
Connecting to sourceforge.net||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18846 (18K) [text/html]
Saving to: `download'

     0K .......... ........                                   100% 6.30K=2.9s

2012-08-21 09:52:25 (6.30 KB/s) - `download' saved [18846/18846]

--2012-08-21 09:52:25--  http://sourceforge.net/projects/wxpython/files/wxPython/
Connecting to sourceforge.net||:80... connected.
HTTP request sent, awaiting response... 200 OK

    The file is already fully retrieved; nothing to do.

FINISHED --2012-08-21 09:52:28--
Downloaded: 1 files, 18K in 2.9s (6.30 KB/s)

As you can see in this log file, I end up in getting a single HTML file :(

This shows that wget doesn't waits on the page to let webpage to redirect it to another location, and it downloads the page itself.


I want those two files, with wget, how can I?


It seems redirection is disabled at your wget, try specifying --max-redirect=2 or a higher number. You probably also want to specify --trust-server-names to allow wget to update the file name after redirection, otherwise the downloaded files will still be called download.

|improve this answer|||||
  • I set those two options, but still getting an HTML file. – Santosh Kumar Aug 21 '12 at 6:05
  • @Santosh Interesting, it works here. Which wget version do you use? – scai Aug 21 '12 at 6:06
  • GNU Wget 1.12 built on linux-gnu. – Santosh Kumar Aug 21 '12 at 6:14
  • 1
    Try commenting out all configurations in your .wgetrc file. Then comment in one after the other and call the wget command from above. You should see which of your configurations leads to the strange behaviour. – scai Aug 21 '12 at 13:42
  • 1
    I found that --user-agent was creating the problem. I don't know why. – Santosh Kumar Mar 1 '13 at 8:04

Your Case is redirect , But when you redirect just for your cookies, FireFox has two extension that one export a txt file from your cookie with wget format, and second import it. Then you use :

wget --load-cookies your_cookies_file.txt your_URL
|improve this answer|||||

It could be that before downloading the website requires some cookies to be set (for example to know that you're a logged in user, or that you've accepted the license agreement, etc). So, your download should work fine when done from the browser but would fail with wget.

You can look up the missing cookie depending on your use case, and either use the authentication options available with wget or simply send the cookie data using the --header option.

Hope that solves your issue.

|improve this answer|||||
  • 1
    No, you don't need any cookies. Try wget http://sourceforge.net/projects/wxpython/files/wxPython/ – Freddy Oct 8 '19 at 16:13
  • That's the solution for this particular website. I was mentioning the more common one. – krishnakeshan Oct 10 '19 at 15:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.