【问题标题】:read values in an html file using shell script使用 shell 脚本读取 html 文件中的值
【发布时间】:2019-02-22 06:50:11
【问题描述】:

我需要使用 shell 脚本从 html 内容中解析值。 例如:

<tr class="abc" some-value ="12344">1000</tr>
<tr class="abc" some-value ="134556">2000</tr>

假设在 HTML 页面中有 50 个相同的&lt;tr&gt; &lt;/tr&gt;,如上面的示例中所述。使用 shell 我需要得到这 50 个 &lt;tr&gt; &lt;/tr&gt;。如果有人可以帮助我,将不胜感激。

【问题讨论】:

    标签: shell


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2017-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-24
      • 2021-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多