My script:
def fetch_online():
pattern = re.search('(<span class="on">)(.*)(</span>)', data)
return pattern.group(2)
print fetch_online()
Inside data
, there is one line that contains this:
<b><span><span class="on">5879</span> users online</span></b>
However, when ran, the output is this:
5879</span> users online
How should I fix this so it only grabs the data before the first </span>
?