shell - 使用 shell 脚本读取 html 文件中的值
问题描述
我需要使用 shell 脚本从 html 内容中解析值。前任:
<tr class="abc" some-value ="12344">1000</tr>
<tr class="abc" some-value ="134556">2000</tr>
假设在 HTML 页面 50 中<tr> </tr>
存在与上述示例中相同的内容。使用 shell 我需要得到那些 50 <tr> </tr>
。如果有人可以帮助我,将不胜感激。
解决方案
您可以使用该xpath
命令- 这样的东西应该可以工作:
xpath ./index.html '//tr/text()'
推荐阅读
- php - 使用 Laravel Eloquent ORM 连接另外四个表
- c++ - Qt中的整数用户输入
- javascript - Angular 组件不会刷新 UI
- php - 此集合实例上不存在属性 [stock]
- javascript - React + Typescript 错误“参数类型‘事件’和‘事件’不兼容。” 对于 MaterialUI 选择事件处理程序
- python-3.x - 使用 Boto3 Python 代码创建 AWS Lambda 函数?
- python - 如何使用 OneHot 编码数据拆分 toTrain_test?
- reactjs - 使用 Material UI 步进器时,React Hook Form 不注册输入
- .net - Mapster 编译时出现 AmbiguousMatchException
- css - 将 css 类添加到具有特定名称的特定 xtype