为什么 wget 会忽略 URL 中的查询字符串? [英] Why does wget ignore the query string in the URL?

查看:24
本文介绍了为什么 wget 会忽略 URL 中的查询字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 wget 下载以下 18 个 HTML 文件:

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

无论page= 之后是什么,它总是下载列表的第一页.我是否必须转义 URL 中的某些字符?怎么样?

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?

推荐答案

& 是大多数 shell 环境中的特殊字符.您可以使用双引号引用 URL 以将整个内容作为参数传递给 wget:

& 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"

这篇关于为什么 wget 会忽略 URL 中的查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆