关于解析html并使用shell提取数据
16lz
2021-01-22
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。
更多相关文章
- 经典炫酷的HTML5/jQuery动画应用示例及源码
- PHP实现WebSocket示例
- PHP基础示例:商品信息管理系统v1.1[转]
- 040-PHP使用闭包函数来进行父实例的变量自增,正确示例
- mysql锁机制之示例讲解
- MySQL 示例数据库sakila
- MySQL官网示例数据库emploees分析使用
- 高德地图api接口poi检索示例----并在信息框显示经纬度
- Objective-C方法/函数调用。 (来自javascript示例)