bs4.NavigableString.insert_before

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