多くのテーブルを含む html ページがあります。
<html>
<table>
POINTER_TEXT
some other stuff
<table that i want START>
</table that i want END>
some other stuff
<table bad>
</table bad>
</table>
</html>
特定のテキストの後にあるテーブルを取得したいと考えています。この段階までは元気です。
curl -silent http://xyz.com/1.htm | sed -n '/POINTER_TEXT/,$p'
これは私に与えます
POINTER_TEXT
some other stuff
<table that i want START>
</table that i want END>
some other stuff
<table bad>
</table bad>
</table>
</html>
次に、これを追加します。
curl -silent http://xyz.com/1.htm | sed -n '/POINTER_TEXT/,$p' | sed -n '/<table*/,/<\/table>/p'
これは私にこれを与えます:
<table that i want START>
</table that i want END>
<table bad>
</table bad>
私の問題は、これが必要なだけです:
<table that i want START>
</table that i want END>
みんな助けてください!