没有任何标题的wget [英] wget without any headers

查看:133
本文介绍了没有任何标题的wget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取没有标题的文件.我尝试过很多类似的事情

I would like to get the files without headers. I have tried many things like

wget --header="" http://xxxxx.xxxxxx.xx

如何获取没有标题的任何文件?

How can I get any files without headers?

推荐答案

是否可以将wget的输出分配给字符串,然后使用其他方式处理它以删除标头(或从文本中解析出标头),例如

Could you assign the output of wget to a string, then use something else to process it to drop headers (or parse them out of the text), such as

w1=$(wget --quiet --output-document - www.example.com)
echo $w1 | grep --only-matching "<body>.*</body>"

给予(添加换行符以便在此处很好地显示):

giving (adding newlines to display nicely here):

<body> <div> <h1>Example Domain</h1> <p>This domain is established to be used for 
illustrative examples in documents. You may use this domain in examples without 
prior coordination or asking for permission.</p> <p><a href="http://www.iana.org
/domains/example">More information...</a></p> </div> </body>

这篇关于没有任何标题的wget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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