MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / html_from_tree

Function html_from_tree

seleniumbase/undetected/cdp_driver/cdp_util.py:913–930  ·  view source on GitHub ↗
(
    tree: Union[cdp.dom.Node, Element], target: Tab
)

Source from the content-addressed store, hash-verified

911
912
913async def html_from_tree(
914 tree: Union[cdp.dom.Node, Element], target: Tab
915):
916 if not hasattr(tree, "children"):
917 raise TypeError("Object should have a .children attribute!")
918 out = ""
919 if tree and tree.children:
920 for child in tree.children:
921 if isinstance(child, Element):
922 out += await child.get_html()
923 else:
924 out += await target.send(
925 cdp.dom.get_outer_html(
926 backend_node_id=child.backend_node_id
927 )
928 )
929 out += await html_from_tree(child, target)
930 return out
931
932
933def compare_target_info(

Callers

nothing calls this directly

Calls 2

get_htmlMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…