First child with tag in `tagnames`, or None if not found.
(self, *tagnames: str)
| 654 | ) |
| 655 | |
| 656 | def first_child_found_in(self, *tagnames: str) -> _Element | None: |
| 657 | """First child with tag in `tagnames`, or None if not found.""" |
| 658 | for tagname in tagnames: |
| 659 | child = self.find(qn(tagname)) |
| 660 | if child is not None: |
| 661 | return child |
| 662 | return None |
| 663 | |
| 664 | def insert_element_before(self, elm: ElementBase, *tagnames: str): |
| 665 | successor = self.first_child_found_in(*tagnames) |