How to download multiple urls using wget using a single command?

user1915050 picture user1915050 · Jan 29, 2013 · Viewed 46.4k times · Source

I am using following command to download a single webpage with all its images and js using wget in win7:

wget -E -H -k -K -p -e robots=off -P /Downloads/ http://www.vodafone.de/privat/tarife/red-smartphone-tarife.html

It is downloading the html as required, but when I tried to pass on a text file having a list of 3 urls to download, it didn't give any output, below is the command I am using:

wget -E -H -k -K -p -e robots=off -P /Downloads/ -i ./list.txt -B 'http://'

I tried this also:

wget -E -H -k -K -p -e robots=off -P /Downloads/ -i ./list.txt

This text file had urls http:// prepended in it

list.txt contains list of 3 urls which I need to download using a single command. Please help me in resolving this issue.

Answer

Olaf Dietsche picture Olaf Dietsche · Jan 29, 2013

From man wget

2 Invoking
By default, Wget is very simple to invoke. The basic syntax is:
wget [option]... [URL]...

So, just use multiple URLs

wget URL1 URL2

Or using the links from comments

$ cat list.txt
http://www.vodafone.de/privat/tarife/red-smartphone-tarife.html
http://www.verizonwireless.com/smartphones-2.shtml
http://www.att.com/shop/wireless/devices/smartphones.html

and your command line

wget -E -H -k -K -p -e robots=off -P /Downloads/ -i ./list.txt

works as expected.