My aim is to download only the files available on websites such as those on http://pelusa.fis.cinvestav.mx/tmatos/LaSumA/LaSumA2_archivos/NumeRCPs/ansi/index.htm under the "Access via Directories:" title. How can I achieve my aim I am not familiar with wget and I do not want to obtain the html files, I would like to download only the *.c and *.h files on that site for example. Is it possible? I think downloading specific file types and saving to a desired place is a function provided by wget.
3 Answers
Most times it's quite more handy to stick to the browser (assuming firefox): Therefore you need a kind of download manager:
FoxySpider (https://addons.mozilla.org/de/firefox/addon/foxyspider/) does recursive fetching of files for specified types of files (file extensions) ("Well, actually get any file type you want from an entire website").
Also DownThemAll (http://www.downthemall.net/) does it ("DownThemAll lets you download all the links or images contained in a webpage and much more: you can refine your downloads by fully customizable criteria to get only what you really want.").
-
Well this is a nice suggestion I think it supports the same functionality in different OSs, am I right?– VesnogApr 14, 2014 at 10:47
-
surely: used that for years on any kind of windows and Linux at least, also Ubuntu– SLNApr 14, 2014 at 10:49
-
+1 for downthemall with this you can easily download all kind of data. Even streamed video are possible with a bit of hacking.– jnovachoApr 14, 2014 at 12:33
This will retrieve all .c and .h files:
wget -r -l1 --no-parent -A c,h http://pelusa.fis.cinvestav.mx/tmatos/LaSumA/LaSumA2_archivos/NumeRCPs/ansi/recipes/
Result will be a directory structure
pelusa.fis.cinvestav.mx/
tmatos/
LaSumA/
LaSumA2_archivos/
NumeRCPs/
ansi/
recipes/
and the .c and .h files will be in recipes/ (it will not save in the same target directory since that could overwrite files).
There are other tools that might be easier, like lftp (it supports globbing better than wget).
-
Thanks for your reply can the two separate commands be combined so that both c files and h files are retrieved with the execution of a single command?– VesnogApr 14, 2014 at 10:46
-
here: gnu.org/software/wget/manual/html_node/Types-of-Files.html It is easier than that :) edit: hmm playing with it and wget seems to not follow its own manual >:D– RinzwindApr 14, 2014 at 10:56
In flareget download manager, you can use batch downloader to achieve the same. It supports wild cards too. In file menu click batch download or you can even import links from a website using import option.