Why wget ignores query string in the url?

Majid Fouladpour picture Majid Fouladpour · Oct 20, 2014 · Viewed 22.7k times · Source

I want to use wget to download the following 18 html files:

http://www.ted.com/talks/quick-list?sort=date&order=desc&page=18  
http://www.ted.com/talks/quick-list?sort=date&order=desc&page=17  
...  
http://www.ted.com/talks/quick-list?sort=date&order=desc&page=1

No matter what comes after page=, it always downloads the first page of the listing. Do I have to escape some characters in the urls? How?

Answer

hrbrmstr picture hrbrmstr · Oct 20, 2014

& is a special character in most shell environments, you can use double quotes to quote the URL to pass the whole thing in as the parameter to wget:

wget "http://www.ted.com/talks/quick-list?sort=date&order=desc&page=18"