bs4.BeautifulSoup.find_previous_siblings

BeautifulSoup.find_previous_siblings(name=None, attrs={}, text=None, limit=None, **kwargs)

Returns the siblings of this Tag that match the given criteria and appear before this Tag in the document.