Returns the closest parent of this Tag that matches the given criteria.
(self, name=None, attrs={}, **kwargs)
| 318 | fetchPreviousSiblings = findPreviousSiblings # Compatibility with pre-3.x |
| 319 | |
| 320 | def findParent(self, name=None, attrs={}, **kwargs): |
| 321 | """Returns the closest parent of this Tag that matches the given |
| 322 | criteria.""" |
| 323 | # NOTE: We can't use _findOne because findParents takes a different |
| 324 | # set of arguments. |
| 325 | r = None |
| 326 | l = self.findParents(name, attrs, 1) |
| 327 | if l: |
| 328 | r = l[0] |
| 329 | return r |
| 330 | |
| 331 | def findParents(self, name=None, attrs={}, limit=None, **kwargs): |
| 332 | """Returns the parents of this Tag that match the given |