首页 > 解决方案 > 使用 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>。如果有人可以帮助我,将不胜感激。

标签: shell

解决方案


您可以使用该xpath命令- 这样的东西应该可以工作:

xpath ./index.html '//tr/text()'

推荐阅读