That opening span is still a line above, you'll need to sockread again. If the span is the last line in the buffer at the time and the event retriggers you'll need to keep track of this fact with a variable.
So you might upon finding the span-h5, set a variable: "set %span-h5 1", on your next read you check if (%span-h5 == 1) then you know the line you're reading is the content you're looking for. unset %span-h5 and strip out the whitespace before the content with regex: %temp = $regsubex(%temp,^\s+,)
If the content you're looking for is more than one line away set your variable to the number of lines, keep a counter for how many more lines you've read, and compare them to know when you're on the line with the content you want.