Wget将我的URL地址的一部分识别为语法错误 [英] Wget recognizes some part of my URL address as a syntax error
问题描述
我对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 or external command
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中具有特殊含义.用\
进行转义,或将网址放在引号中,以避免出现此问题.
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
In many Unix shells, putting an &
after a command causes it to be executed in the background.
这篇关于Wget将我的URL地址的一部分识别为语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!