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

Method get_descendants

webarena/browser_env/html_tools/html_parser.py:312–321  ·  view source on GitHub ↗
(node: html.HtmlElement, max_depth: int, current_depth: int=0)

Source from the content-addressed store, hash-verified

310 return anscendants
311
312 def get_descendants(node: html.HtmlElement, max_depth: int, current_depth: int=0) -> list[str]:
313 if current_depth > max_depth:
314 return []
315
316 descendants = []
317 for child in node:
318 descendants.append(child)
319 descendants.extend(get_descendants(child, max_depth, current_depth + 1))
320
321 return descendants
322
323 to_keep = set(copy.deepcopy(keep))
324 nodes_to_keep = set()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected