(tree: html.HtmlElement)
| 129 | |
| 130 | @staticmethod |
| 131 | def get_root(tree: html.HtmlElement) -> html.HtmlElement: |
| 132 | node = tree.xpath('//*')[0] |
| 133 | while True: |
| 134 | parent = node.getparent() |
| 135 | if parent is None: |
| 136 | break |
| 137 | node = parent |
| 138 | return node |
| 139 | |
| 140 | def get_node_by_bid(self, tree: html.HtmlElement, bid: str) -> html.HtmlElement: |
| 141 | nodes = tree.xpath(f'//*[@{self.id_attr}="{bid}"]') |
no outgoing calls
no test coverage detected