MCPcopy Create free account
hub / github.com/THUDM/AutoWebGLM / get_root

Method get_root

miniwob++/html_tools/html_parser.py:131–138  ·  view source on GitHub ↗
(tree: html.HtmlElement)

Source from the content-addressed store, hash-verified

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}"]')

Callers 2

mark_idMethod · 0.95
parse_treeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected