(self, tree: html.HtmlElement, bid: str)
| 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}"]') |
| 142 | if len(nodes) == 0: |
| 143 | return None |
| 144 | return nodes[0] |
| 145 | |
| 146 | def id_label_converter(self, label: str) -> str: |
| 147 | return self.bids2label.get(label, '') |