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

Method get_segment

webarena/browser_env/html_tools/html_parser.py:407–413  ·  view source on GitHub ↗
(self, bid: str)

Source from the content-addressed store, hash-verified

405 self.dom_tree = new_tree
406
407 def get_segment(self, bid: str) -> str:
408 # clone the tree
409 new_tree = copy.deepcopy(self.dom_tree)
410 nodes_to_keep = self.get_keep_elements(new_tree, [bid], 0, 2, 1)
411 new_tree = self.prune(new_tree, nodes_to_keep)
412 dom, _ = self.parse(new_tree, self.keep, [], False)
413 return dom
414
415 def get_rect_data(self, bids: list[str]) -> list[dict[str]]:
416 res = []

Callers 2

_extract_actionMethod · 0.45
_extract_actionMethod · 0.45

Calls 3

get_keep_elementsMethod · 0.95
pruneMethod · 0.95
parseMethod · 0.95

Tested by

no test coverage detected