I’m honestly finding BeautifulSoup too difficult, the documentation doesn’t explain the basics I’m looking for.
I am trying to return the string inside a tag that has an attribute:
<span class="on">6220</span>
But running this:
def fetch_online():
users = page('span', {'class' : 'on'})
return str(users)
Gives me [<span class="on">6220</span>]. So I figured I’m doing it all wrong, what is the way to just get a simple string out of a tag?
You can do it like this: