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

查看:212
本文介绍了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 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

在许多Unix shell中,在命令后放置&会使它成为

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

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

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