parser.parse("...") is using the html5lib library's internal Beautiful
Soup 3 support (import BeautifulSoup) to create a Beautiful Soup 3
tree. To get a Beautiful Soup 4 tree, you need to use:
import bs4
data = bs4.BeautifulSoup(html, features="html5lib")
That uses Beautiful Soup 4's support for the html5lib parser instead
of the other way around. It will produce a tree with bs4.element.Tag
objects.
> This creates a tag, but it is a bs4.element.Tag and not a BeautifulSoup.Tag like all of the tags in "data," and it doesn't work or respond like a regular tag.
What are the differences in the behavior of Beautiful Soup 4's Tag?
Tag's behavior needs to be essentially identical to Beautiful Soup 3.
-Aaron DeVore