How to extract data from html table in shell script?

前端 未结 6 1459
[愿得一人]
[愿得一人] 2020-11-30 11:42

I am trying to create a BASH script what would extract the data from HTML table. Below is the example of table from where I need to extract data:

6条回答
  •  隐瞒了意图╮
    2020-11-30 12:10

    You can use bash xpath (XML::XPath perl module) to accomplish that task very easily:

    xpath -e '//tr[position()>1]' test_input1.xml 2> /dev/null | sed -e 's/<\/*tr>//g' -e 's/
//g' -e 's/<\/td>/ /g'

提交回复
热议问题