I need to parse a html and extract 4 parts of the html using shell script. However, I am quite new to shell. I just start by a for loop to cat $1 to look through each line of the html. Can anybody help me or give me advice?

我需要解析一个html并使用shell脚本提取4个部分的html。但是,我对shell很新。我只是从一个for循环开始,以$ 1来浏览html的每一行。有人可以帮助我或给我建议吗?

4 个解决方案

#1


3

HTML-XML-utils

You may use htmlutils for parsing well-formatted HTML/XML files. The package includes a lot of binary tools to extract or modify the data. For example:

您可以使用htmlutils来解析格式良好的HTML / XML文件。该软件包包含许多用于提取或修改数据的二进制工具。例如:

$ curl -s http://example.com/ | hxselect title
<title>Example Domain</title>

For more examples, check the html-xml-utils.

有关更多示例,请查看html-xml-utils。

更多相关文章

  1. 经典炫酷的HTML5/jQuery动画应用示例及源码
  2. PHP实现WebSocket示例
  3. PHP基础示例:商品信息管理系统v1.1[转]
  4. 040-PHP使用闭包函数来进行父实例的变量自增,正确示例
  5. mysql锁机制之示例讲解
  6. MySQL 示例数据库sakila
  7. MySQL官网示例数据库emploees分析使用
  8. 高德地图api接口poi检索示例----并在信息框显示经纬度
  9. Objective-C方法/函数调用。 (来自javascript示例)

随机推荐

  1. c语言if语句格式是什么?
  2. c#为什么用的人很少
  3. c语言中如何让3个数按大小输出?
  4. C语言中double是什么意思?
  5. c++大小写字母转换的思路有几种?
  6. PHP代码如何转 .NET?
  7. C语言中数组元素的下标下限是什么
  8. c语言如何实现做界面
  9. c语言return的用法是什么?
  10. “->” 在 C 语言什么意思?