Returns the closest parent of this Tag that matches the given criteria.
(self, name=None, attrs={}, **kwargs)
| 303 | fetchPreviousSiblings = findPreviousSiblings # Compatibility with pre-3.x |
| 304 | |
| 305 | def findParent(self, name=None, attrs={}, **kwargs): |
| 306 | """Returns the closest parent of this Tag that matches the given |
| 307 | criteria.""" |
| 308 | # NOTE: We can't use _findOne because findParents takes a different |
| 309 | # set of arguments. |
| 310 | r = None |
| 311 | l = self.findParents(name, attrs, 1) |
| 312 | if l: |
| 313 | r = l[0] |
| 314 | return r |
| 315 | |
| 316 | def findParents(self, name=None, attrs={}, limit=None, **kwargs): |
| 317 | """Returns the parents of this Tag that match the given |
nothing calls this directly
no test coverage detected