bs4.Doctype.insert_before

Doctype.insert_before(predecessor)

Makes the given element the immediate predecessor of this one.

The two elements will have the same parent, and the given element will be immediately before this one.