Parsing HTML, get text between 2 HTML tags

Hi there, I'm quite new to the forum and shell scripting.

I want to filter out the "166.0 points". The results, that i found in google / the forum search didn't helped me :frowning:

<a href="/user/test" class="headitem menu" style="color:rgb(83,186,224);">test</a><a href="/points" class="headitem menu">166.0 points</a>
<div id="inhalt"><div class="contenthead"><h4>your points</h4><span>166.0 points</span></div><div class="mod point_stats">

It might be very easy for you, but it would help me alot!
Thanks in advance!

Hi Mysthik,

One way:

$ cat infile
<a href="/user/test" class="headitem menu" style="color:rgb(83,186,224);">test</a><a href="/points" class="headitem menu">166.0 points</a>
<div id="inhalt"><div class="contenthead"><h4>your points</h4><span>166.0 points</span></div><div class="mod point_stats">
$ perl -ne 'printf qq[%s\n], $1 if m/<span>([^<]+)<\/span>/' infile
166.0 points