Wget 将我的 URL 地址的某些部分识别为语法错误 [英] Wget recognizes some part of my URL address as a syntax error

查看:36
本文介绍了Wget 将我的 URL 地址的某些部分识别为语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 wget 很陌生,我在 Google 上进行了研究,但没有发现任何线索.

I am quite new with wget and I have done my research on Google but I found no clue.

我需要保存一个网页的 HTML 文件:

I need to save a single HTML file of a webpage:

wget yahoo.com -O test.html

它有效,但是,当我尝试更具体时:

and it works, but, when I try to be more specific:

wget http://search.yahoo.com/404handler?src=search&p=food+delicious -O test.html

问题来了,wget&p=food+delicious 识别为语法,它说:'p' is not Recognized as an internal或外部命令

here comes the problem, wget recognizes &p=food+delicious as a syntax, it says: 'p' is not recognized as an internal or external command

我该如何解决这个问题?非常感谢您的建议.

How can I solve this problem? I really appreciate your suggestions.

推荐答案

&在shell中有特殊含义.使用 对其进行转义或将 url 放在引号中以避免此问题.

The & has a special meaning in the shell. Escape it with or put the url in quotes to avoid this problem.

wget http://search.yahoo.com/404handler?src=search&p=food+delicious -O test.html

wget "http://search.yahoo.com/404handler?src=search&p=food+delicious" -O test.html

在许多 Unix shell 中,在命令后放置 & 会导致它成为 在后台执行.

In many Unix shells, putting an & after a command causes it to be executed in the background.

这篇关于Wget 将我的 URL 地址的某些部分识别为语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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