bs4.Tag.index

Tag.index(element)[source]

Find the index of a child by identity, not value. Avoids issues with tag.contents.index(element) getting the index of equal elements.