I'm not sure that Beautiful soup knows what you are saying.
It's more like it uses some engine to parse and fix the HTML.
It has this method soup.get_text()
which returns all the text in HTML.
Maybe you are looking for this.
If not then it would help understand why you need such a function.