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

Method get_root

webarena/browser_env/html_tools/html_parser.py:136–143  ·  view source on GitHub ↗
(tree: html.HtmlElement)

Source from the content-addressed store, hash-verified

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

Callers 2

mark_idMethod · 0.95
parse_treeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected