You can do this many way, but here is one example how to use parameter expansion.
Code:
#!/bin/ksh
# read lines from stdin
while read line
do
# remove begin of line including <html>
a1=${line#*<html>}
# remove end of line including </html>
a2=${a1%</html>*}
# remove all char except numbers (replace not numbers with nothing)
a3=${a2//[^0-9]/}
print $a3
done