bs4.BeautifulStoneSoup.findPreviousSibling

BeautifulStoneSoup.findPreviousSibling(name=None, attrs={}, text=None, **kwargs)

Returns the closest sibling to this Tag that matches the given criteria and appears before this Tag in the document.