仅使用 sed 或 awk 从 html 页面中提取 url 的最简单方法 [英] Easiest way to extract the urls from an html page using sed or awk only
本文介绍了仅使用 sed 或 awk 从 html 页面中提取 url 的最简单方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从 html 文件的锚标记中提取 URL.这需要使用 SED/AWK 在 BASH 中完成.请不要使用 perl.
I want to extract the URL from within the anchor tags of an html file. This needs to be done in BASH using SED/AWK. No perl please.
最简单的方法是什么?
推荐答案
你也可以这样做(前提是你安装了 lynx)...
You could also do something like this (provided you have lynx installed)...
Lynx 版本
2.8.8
Lynx versions < 2.8.8
lynx -dump -listonly my.html
Lynx 版本 >= 2.8.8(@condit 提供)
Lynx versions >= 2.8.8 (courtesy of @condit)
lynx -dump -hiddenlinks=listonly my.html
这篇关于仅使用 sed 或 awk 从 html 页面中提取 url 的最简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文