bs4.BeautifulSoup.findParent

BeautifulSoup.findParent(name=None, attrs={}, **kwargs)

Returns the closest parent of this Tag that matches the given criteria.