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