bs4.Tag.insert_before

Tag.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.