使用awk或者sed提取一个html页面的URL最简单的方法只 [英] Easiest way to extract the urls from an html page using sed or awk only

查看:1354
本文介绍了使用awk或者sed提取一个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.

什么是做最简单的方法?

What is the easiest way to do this?

推荐答案

您也可以做这样的事情(只要你安装了猞猁)...

You could also do something like this (provided you have lynx installed)...

山猫版本< 2.8.8

Lynx versions < 2.8.8

lynx -dump -listonly my.html

山猫版本> = 2.8.8(@condit提供)

Lynx versions >= 2.8.8 (courtesy of @condit)

lynx -dump -hiddenlinks=listonly my.html

这篇关于使用awk或者sed提取一个html页面的URL最简单的方法只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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