获取网页标题,图,从Linux终端的元数据信息 [英] Getting Webpage Title, Img, Metadata info from Linux Terminal
问题描述
有没有什么办法,或者我可以用从SH脚本,网页标题得到任何工具,元数据,如描述,也许是网页或类似的东西的一个小屏幕截图?
is there any way or any tools that I could use to get from a SH script, a webpage title, metadata such as descriptions, maybe a little screenshot of the webpage or anything like that?
在此先感谢!
推荐答案
您可以使用卷曲或wget来获取网页,然后通过管道它的sed得到各种标记的内容。这是缺憾的为的,但还挺你会得到,如果你正在做这个东西有一个shell脚本什么。
you could use curl or wget to get the webpage, and then pipe it to sed to get the contents of various tags. It's kludgy as, but that's kinda what you're going to get if you're doing this stuff with a shell script.
例如
wget http://example.com -O - | grep \<title\>|sed "s/\<title\>\([^<]*\).*/\1/"
会给你的标题标签中的内容。请注意,在这个例子中它给你的原始未解析源,所以它看起来像 IANA和放大器; MDASH;例如域
而不是 IANA - 例如域
你有没有使用类似perl的考虑?
Have you considered using something like perl?
这篇关于获取网页标题,图,从Linux终端的元数据信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!